Sunday 15 August 2010

jquery - How to Add Class to Bootstrap Thumbnails on Slider Change -


Can you please take a look and tell me how I can add a class. Gallery Carroll - Computer clicks on thumb?

As you can see from the code, I am using the following code to highlight the selected thumb:

  var classHighlight = 'highlight'; Var $ thumb = $ ('thumbnail'). Click (function (e) {e.preventDefault (); $ thumbs.removeClass (classHighlight); $ (this) .addClass (classHighlight);});   

OK, I'm not sure this is the right way but it's working for me! But as I said it. Is working on clicking, but what I need to do is add the class to the thumbnail on the sliding event. I already add this code to my code but it is not working!

 . Thumbnail: Active {border style: solid; Border-width: 5px; Border-color: gery; }   

Thank you for your time and comments

To do this, on the slide function (the rows below 2 have been added):

  // When updating carousel slides, auto text $ ('# myCarousel') . ('Data' ('Slide-Number'); $ ('# Carousel-Text'). Html ($ ('# slide-content-', 'slid', function (e) {var id = $ (' Item.active '' + ID) .HTML ()); $ ('# slider-thumb & gt; div & gt; ul & gt; li & gt; a'). RemoveClass ('Highlight'); $ ( '#brandola-selector-' + ID) .addClass ('Highlight');});    

To select the first thumbnail on page load, Add, after the start of the carousel:

  $ ('# carousel-selector -0') addClass ('highlight').    

body:

No comments:

Post a Comment