a jquery question

Locked
Results 1 to 8 of 8
This thread is locked. New replies are disabled.
30 Aug 2009, 22:41
#1
g_force avatar

g_force

Zen Follower

Join Date:
Feb 2009
Posts:
354
Plugin Contributions:
0

a jquery question

If you know anything about Jquery you may just be able to help here...

I'm currently using Jquery to bring up products in a lightbox on rolling over them on the product_listing page - this works well.. however the technique that I'm using requires that the <a href> tag is referenced to the image brought up in the lightbox - e.g.

<a href="images/1_MED.jpg" class="preview"><img src="images/1.jpg" alt="gallery thumbnail" /></a>


.. this of course means that clicking on that image's thumbnail will take you to the URL of the image rather than it's product_info page as I need.

Does anyone understand this problem and have any suggestions?? - I've already tried to put an onmousedown link in there but it only occasionally overrides the <a href> link tag - any help is highly appreciated!

_thanks
31 Aug 2009, 02:14
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: a jquery question

You should bind the click event to those href and return false; to prevent the "click" event to take the users to the images.
31 Aug 2009, 10:05
#3
g_force avatar

g_force

Zen Follower

Join Date:
Feb 2009
Posts:
354
Plugin Contributions:
0

Re: a jquery question

this sounds like good advice - any idea how?

_thanks
31 Aug 2009, 15:01
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: a jquery question

example
$('a.preview').live('click', function(){return false;});
31 Aug 2009, 16:07
#5
g_force avatar

g_force

Zen Follower

Join Date:
Feb 2009
Posts:
354
Plugin Contributions:
0

Re: a jquery question

Thanks for the response..

I attempted to put this into my js file but it didn't help - am I putting it in the wrong place and will it allow a link to the individual product info page??

_thanks
01 Sep 2009, 03:53
#6
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: a jquery question

Again, the code is for example. If you want the user to be redirected to the product info page then obviously the href needs to be that link, and hence you will need to change the logic of the lightbox a bit because right now you are using href for the image path.
01 Sep 2009, 08:59
#7
g_force avatar

g_force

Zen Follower

Join Date:
Feb 2009
Posts:
354
Plugin Contributions:
0

Re: a jquery question

Oh thanks... but you indicated that it could be done: -

You should bind the click event to those href and return false; to prevent the "click" event to take the users to the images.


and I'm not sure what the example was for if not to show me how it could be done:

example
$('a.preview').live('click', function(){return false;});


I've been told that almost anything can be done in javascript so I'm still hoping there is a way to redirect the link with the simple method that I'm using for the lightbox. Any further suggestions or comments are welcome as these have been.

_thanks
05 Sep 2009, 22:59
#8
g_force avatar

g_force

Zen Follower

Join Date:
Feb 2009
Posts:
354
Plugin Contributions:
0

Re: a jquery question

I should thank you as this is what actually prevented the mouseclick:

$('a.preview').click(function(){return false;});


..now I just need to redirect it to the individual product_info page.. any thoughts on this could definitely help!! <<

_thanks