lundi 2 mars 2015

How do I run a jQuery if statement on a function paremeter?

I'm trying to avoid excessive code by simplifying my Slick Slider script. I'm trying to run a function that sets a boolean parameter but I'm obviously missing something here. Can anyone help me pinpoint what I'm doing wrong?


Thanks!



$( window ).load(function() {
var galleryStyle = true;
var $gallerySlider = $("div.content-gallery-wrapper .content-gallery"),function(){
if ( $gallerySlider.hasClass("casestudy") ) {
var galleryStyle = false;
} else {}
};

$gallerySlider.each(function(){
$(this).slick({
centerMode: true,
centerPadding: '0',
slidesToShow: 1,
slidesToScroll: 1,
// dots: true,
prevArrow: '.arrow.left',
nextArrow: '.arrow.right',
fade: galleryStyle
});
});

$('.loading').removeClass('loading');
});

Aucun commentaire:

Enregistrer un commentaire