Loading

Creative — newslider

Posted On: Saturday, April 9, 2016 at 6:28 AM
Last updated: Saturday, April 9, 2016 at 6:36 AM

This is a slider with jscript

Joined on Friday, April 8, 2016
Contributed 5 Snips

Get Social and Share

Tags

PREVIEW SNIPP

body { padding-top: 20px; } #myCarousel .nav a small { display:block; } #myCarousel .nav { background:#eee; } #myCarousel .nav a { border-radius:0px; }$(document).ready( function() { $('#myCarousel').carousel({ interval: 4000 }); var clickEvent = false; $('#myCarousel').on('click', '.nav a', function() { clickEvent = true; $('.nav li').removeClass('active'); $(this).parent().addClass('active'); }).on('slid.bs.carousel', function(e) { if(!clickEvent) { var count = $('.nav').children().length -1; var current = $('.nav li.active'); current.removeClass('active').next().addClass('active'); var id = parseInt(current.data('slide-to')); if(count == id) { $('.nav li').first().addClass('active'); } } clickEvent = false; }); });