stevenwanderski / bxslider-3

jQuery custom content slider
http://bxslider.com
447 stars 101 forks source link

Bxlisder not Removing slide onBeforeSlide #226

Open JoshChoice opened 10 years ago

JoshChoice commented 10 years ago

Im, trying to remove the first slide after before it loops back around, I would also like to not have the pager visible for that slide the whole time. Ive tried the onBeforeSlide callback so that it runs on the fly and then call the slider.reloadSlider() after to update the changes. I have also tried to manually call the slider.redrawSlider() but that didnt work.

The problem is that it freezes when i call the $(element).remove() on the first element as well as freezes when I call the slider.reloadSlider(). Any help would be much appreciated. My code is below.

  • Landing Opening TV Image
  • ```
  • slide image 1

    1. Just enter your first name.

    Just type your first name into the box on the left this page.

  • slide image 2

    2. Select your best option.

    Simply select the best option for you based on your situation and what you want to accomplish.

  • slide image 3

    3. Zoom throughout the process.

    Breeze through the simple, fun and exciting steps (and skip anything that isn't relevant to you).

  • slide image 4

    4. Get your personal results.

    In just minutes get complete and easy access to the best options (you may never otherwise even know about) and much, much more...


!SCRIPT!
  var landingSlider = $('.bxslider').bxSlider({
       pager: true,
       auto: true,
       autoControls: true,
       pause: 1500,
       onSlideBefore: function($elment, oldIndex, newIndex){
         if($elment.is($("#first-image"))){
             $("#first-image").remove();
             landingSlider.reloadSlider();
             landingSlider.redrawSlider();
         }
       },
       onSlideAfter: function() {
           $('.bx-start').trigger('click');
       }
   });