Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- (function($) {
- $(document).ready(function() {
- var l = 0;
- // document.getElementById("liZero").addEventListener("click", function(){replaceText(0);});
- var item = document.getElementsByClassName("item");
- for (var i = 0; i < item.length; i++) {
- item[i].addEventListener("click", function(){replaceText(i);});
- }
- $(".carousel-control-next").click(function() {
- l++;
- if (l > 4) {
- l = 0;
- }
- replaceText(l);
- });
- $(".carousel-control-prev").click(function() {
- l--;
- if (l < 0) {
- l = 4;
- }
- replaceText(l);
- });
- function replaceText($i) {
- $(".carousel-caption, .about").slideUp(500, function() {
- switch ($i) {
- case 0:
- $('.carousel-caption').text('Open in theaters October 9th');
- break;
- case 1:
- $('.carousel-caption').text("Airs March 7th");
- break;
- case 2:
- $('.carousel-caption').text("In theaters November 21st");
- break;
- case 3:
- $('.carousel-caption').text("Airs July 24th");
- break;
- case 4:
- $('.carousel-caption').text("Airs January 2nd");
- break;
- default:
- $('.carousel-caption').text("Error");
- }
- $(".carousel-caption, .about").slideDown();
- });
- }
- /*
- $(".carousel-control-next").click(function(){
- $(".carousel-caption").slideUp();
- });
- */
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement