Instead of adding and subtracting from the current slide, try this on the ‘slide’ event:
$('.carousel').on('slide',function(e){
var slideFrom = $(this).find('.active').index();
var slideTo = $(e.relatedTarget).index();
console.log(slideFrom+' => '+slideTo);
});
More Related Contents:
- Data-toggle tab does not download Leaflet map
- What’s the easiest way to call a function every 5 seconds in jQuery? [duplicate]
- Make VueJS and jQuery play nice
- Twitter Bootstrap alert message close and open again
- Bootstrap 4 navbar not collapsing on large screen
- How to set the focus for a particular field in a Bootstrap modal, once it appears
- How to fix the error; ‘Error: Bootstrap tooltips require Tether (http://github.hubspot.com/tether/)’
- How to restrict the selectable date ranges in Bootstrap Datepicker?
- Bootstrap datepicker disabling past dates without current date
- How to partition input field to appear as separate input fields on screen?
- How to create a responsive image that also scales up in Bootstrap 3
- Callback function after tooltip / popover is created with twitter bootstrap?
- How to hide Bootstrap modal with javascript?
- Bootstrap dropdown closing when clicked
- Handle open/collapse events of Accordion in Angular
- How well does jQuery support backward compatibility?
- angular.js ng-repeat for creating grid
- bootstrap modal removes scroll bar
- Implementing jquery UI autocomplete to show suggestions when you type “@”
- How to add smooth scrolling to Bootstrap’s scroll spy function
- Make Bootstrap Popover Appear/Disappear on Hover instead of Click
- Bootstrap Carousel image doesn’t align properly
- Bootstrap modal hide is not working
- Twitter bootstrap progress bar animation on page load
- Jquery: Filter dropdown list as you type [closed]
- How to usemultiple Angular UI Bootstrap Datepicker in single form?
- Twitter Bootstrap Popovers not working for Dynamically Generated Content
- How to write a simple jQuery plugin [closed]
- Twitter Bootstrap: Print content of modal window
- disable Bootstrap’s Collapse open/close animation [duplicate]