Log in

View Full Version : CSS Smart Image Enlarger - Disable Link Click?



trixidee
01-07-2011, 10:39 PM
I think the CSS Smart Image Enlarger is really great however I don't want it to open the photo as a link to a new page,.. I just want the rollover effect. Would anyone be kind enough to share a script to disable that link ? Thank you.

jscheuer1
01-08-2011, 07:47 AM
If you mean:

http://www.dynamicdrive.com/style/csslibrary/item/css_smart_image_enlarger/

You could make the link:


<div class="ienlarger"><a href="http://www.dynamicdrive.com/"><img src="http://img406.imageshack.us/img406/4920/63734582.jpg" alt="thumb" class="resize_thumb" /><span>
<img src="http://img406.imageshack.us/img406/4920/63734582.jpg" alt="large" /><br />
Some text can go here.</span></a></div>

like (zooming in on the highlighted part and changing it):


<a href="javascript:void(0);" onclick="return false;">

That way, with javascript enabled it will return false and do nothing. With javascript disabled the browser will recognize it as a javascript link and do nothing. So, either way, you're covered - the link won't fire, and the CSS Smart Image Enlarger still works.