treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Anything slider help, change functionality to hover

  • Hello,

    I am using the AnythingSlider on a couple of sites and I think it's great. However I have been asked if it is possible for the thumbnav links to activate the animation (slide) on hover instead of on click. I'm new to jquery and all things js so apologies if this is a ridiculous question,

    Thanks,

    Ze21
  • Howdy,

    Basically change the click to a hover:


    $(\"#slide-jump\").hover(function(){
    $('.anythingSlider').anythingSlider(6);
    });
  • Thanks for your reply JaredAM. However I'm still not sure where I need to put that code? I can't find any reference to 'slide-jump' in any of the anythingslider code.

    Sorry for being a bit slow,

    Ze21
  • On line 173 of jquery.anythingslider.js you will see this:

    $a.click(function(e){
    base.gotoPage(index);


    Change it to:

    				$a.hover(function(e){
    base.gotoPage(index);
  • Oh, I'm sorry, are you not using Chris' demo? http://css-tricks.com/examples/AnythingSlider/