bx slider DestroyShow conflicts with jquery lavaLamp

434 Views Asked by At

I am having a problem with BX Slider conflicting with LavaLamp.

This is where I am at.

Firstly I have set up my lavalamp menu,

//Initialise Lavalamp
$(function() {
    $(".menu ul").lavaLamp({
        speed: 200,
        fx: 'easeOutBack'
    });
});

and as I am in Wordpress I have added a line that adds the class 'current' to any menu item with the 'current-menu-item' class.

$('.current-menu-item').addClass('current');

This all works perfectly...

However I now want the slideshow only to operate if there are more than 3 slides so I have added the code:

if (slider.getSlideCount() < 4){
    slider.destroyShow()
    $('.slide').removeClass('active-slide');
    $('.carousel div.gradient-top, .carousel div.gradient-bottom, #controls').css("display","none")
}

I have done a bit of poking around and when I take the slider.destroyShow() line out everything works fine again, can anyone think of why this is happening or a way around using destroyShow to achieve the same effect? I am assuming that when the destroyShow command is run it destroys something within the Lavalamp plugin.

Thanks in advance for any help.

0

There are 0 best solutions below