Disable caroufredsel at particular event
I am using caroufredsel in my website, I only want it to active/ work when
windows width is less 960px. It is working when good, I re size browser
window, when it is less then 960px it start working, But problem is when I
again re size window it do not disable even when width is more then 960px,
Is there any way to disable caroufredsel when windows width is more the
959px?
Here is my code:
$(window).on("resize", function () {
if($(window).width() <=959)
{
$('.item-holder').addClass('item-carousel');
$('.item-carousel').carouFredSel(
{
width: "100%",
height:200,
circular: true,
auto : false,
});
$('#portfolio-wrapper .carousel-nav').show();
}
else
{
$('.item-holder').removeClass('item-carousel');
$('.item-carousel').carouFredSel(false);
$('#portfolio-wrapper .carousel-nav').hide();
}
}).resize();
No comments:
Post a Comment