Liam Baxter
Liam Baxter

Reputation: 1

NivoSlider change slide when thumb is hovered not clicked

Hello im hopeing someone can help me, i have my nivoslider set up but im looking to change the way the contral-nav thumbs operate. Out of the box the main images changes when a thumbnail is clicked, im looking to change this to a hover. I found the follwing lines in the nivoslider plugin:

 else {
        nivoControl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>');
       }

        }
        //Set initial active link
        $('.nivo-controlNav a:eq('+ vars.currentSlide +')', slider).addClass('active');

        $('.nivo-controlNav a', slider).live('click', function(){
            if(vars.running) return false;
            if($(this).hasClass('active')) return false;
            clearInterval(timer);
            timer = '';
            slider.css('background','url("'+ vars.currentImage.attr('src') +'") no-repeat');
            vars.currentSlide = $(this).attr('rel') - 1;
            nivoRun(slider, kids, settings, 'control');
        });

I then changed the .live('click, to 'hover' and the slider does change when hovered. the problem lies when trying hovering over the previous thumbnail: the main image does not change i have to go back two items to get it to change again. Anyone have any ideas?

thanks

Upvotes: 0

Views: 3337

Answers (3)

Katie Turner
Katie Turner

Reputation: 11

I had success in altering the jquery plugin code from the following:

.live("click",function(){if(e.running)return false;if(a(this).hasClass("active"))return false;clearInterval(i);

to the following:

.live("mouseover",function(){if(a(this).hasClass("active"))return false;clearInterval(i);

basically changing the click to mouseover, and then removing the "if(e.running)return false;"

Upvotes: 1

Mike
Mike

Reputation: 1

Thx for the link above... for a more easy approach you can use this

    jQuery('#slider .nivo-control, .nivo-prevNav, .nivo-nextNav').live('mousemove',       function()
    {
        jQuery(this).trigger('click');
    });

I used mousemove because i had the problem that if you move fast from one controll element to another it didnt recognize.

Upvotes: 0

Pascal
Pascal

Reputation: 1

Maybe this can help. Try to change the nivo-nextNav to nivo-controlNav:hover and tell me if it works ;)

Upvotes: 0

Related Questions