July 25, 201115 yr Hi guys, Having a few problems getting the first active button to work on this jquery slider: http://www.blendagency.co.uk/portfolio/index.html The active button starts to work after the first slide, but I want it to work on the first slide - any ideas? JS file here: http://www.blendagency.co.uk/js/jquery.lite-content-slider.js Thanks in advacne!
July 25, 201115 yr Hi guys, Having a few problems getting the first active button to work on this jquery slider: http://www.blendagency.co.uk/portfolio/index.html The active button starts to work after the first slide, but I want it to work on the first slide - any ideas? JS file here: http://www.blendagency.co.uk/js/jquery.lite-content-slider.js Thanks in advacne! Manually add this class '.btnactive' to the first link. <div id="sliderButtons"> <!-- change this: --> <a class="buttons bt1" href="#" rel="1"> </a> <!-- to this: --> <a class="buttons bt1 btnactive" href="#" rel="1"> </a> <a class="buttons bt2" href="#" rel="2"> </a> <a class="buttons bt3" href="#" rel="3"> </a> <a class="buttons bt4" href="#" rel="4"> </a> <a class="buttons bt5" href="#" rel="5"> </a> </div> Or you can add a line of code into your plugin js file. return this.each(function(){ init($(this)); // Add the following line. $('.'+options.buttonsClass+':first').addClass('btnactive'); $('.'+options.buttonsClass).click(function(e){ e.preventDefault(); pauseSlide(); goToSlide($(this).attr('rel')); }); $(options.controlBt).click(function(e){ e.preventDefault(); if(playStatus == true){ pauseSlide() }else{ playSlide() } ; }); }); Edited July 25, 201115 yr by PHP Monkey
Create an account or sign in to comment