Question

If you look at the right, there is a thumbnail gallery. I need to change the action from 'on click' to 'on hover'. I'm not a javascript developer and changing scripts at this point will be futile (too many hours modifying this one...for other reasons).

If you could help me find a way to change the action from 'on click' to 'on hover', I'll be greatly appreciated.

Link is this (edit: removed the link, issue is solved, thanks)

To help you guys out, you'll be looking for the /js/jquery.galleriffic.js file

Was it helpful?

Solution

Well looking at the file there are exactly two onclick handlers, which you will have to change to an onmouseenter handler. I don't see why this might take too many hours. Additionally you can just attach an onmouseenter handler to the appropriate link:

$('a.thumb').mouseenter(function(e)
{
    $(this).click();
});

If you don't want it to be clickable anymore you will have to stop the click event bubbling at the bottom element:

$('a.thumb img').click(function(e)
{
    e.stopImmediatePropagation();
});

OTHER TIPS

I added the two snippets above to the footer of my gallery page, within script tags and it worked!

Thanks

<script type="text/javascript">
            //Makes hover work instead of click on gallery
            $('a.thumb').mouseenter(function(e)
{
    $(this).click();
});

$('a.thumb img').click(function(e)
{
    e.stopImmediatePropagation();
});
        </script>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top