PDA

View Full Version : Image Thumbnail Viewer II Mouseout



katebellami
05-31-2012, 09:33 PM
1) Script Title: Image Thumbnail Viewer II

2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

3) Describe problem:

I would like to add a mouseout function so that when the mouse leaves the thumbnail, the image disappears. I would only like the zoomed version to appear when the mouse is hovering. Thanks!

jscheuer1
05-31-2012, 10:34 PM
Put this script in the head of the page after the scripts for the Thumbnail Viewer:


<script type="text/javascript">
jQuery(function($){
var re = /targetdiv\s*:([^,]+)/;
$('a[rel=enlargeimage]').mouseleave(function(){
var la = '#' + $.trim(re.exec(this.getAttribute('rev'))[1]);
$(la).empty().data('$curanchor', '');
});
});
</script>

katebellami
06-01-2012, 12:04 AM
Thanks! It seems to be a bit quirky. It doesnt swap each time when I mouseover. I also have another doozy puzzle. Trying to combine this script with the switch content script so that when you actually click each 'thumbnail' (rather than mouseover, which just switches the image) the description shows up below. Here is the link to the page..any help would be soo appreciated.
http://www.be-eventproductions.com/temp/BEatyourservice.html
I suspect that the href in the thumbnail script is interfering with the span id in the switchgroup.
Thanks again!!

jscheuer1
06-01-2012, 02:57 AM
Put this script in the head of the page after the scripts for the Thumbnail Viewer:


<script type="text/javascript">
jQuery(function($){
var re = /targetdiv\s*:([^,]+)/;
$('a[rel=enlargeimage]').mouseleave(function(){
var la = '#' + $.trim(re.exec(this.getAttribute('rev'))[1]);
$(la).empty().data('$curanchor', '');
});
});
</script>

You put it before. I just tried in a mock up, same problem until I moved it after, then it was fine.