Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. ?>
  5.  
  6. <!DOCTYPE html>
  7. <html lang="en">
  8. <head>
  9.     <meta charset="UTF-8">
  10.     <meta name="viewport" content="width=device-width, initial-scale=1">
  11.     <title>Slider</title>
  12.     <link rel="stylesheet" type="text/css" media="screen" href="cssslider.css" >
  13.     <link rel="stylesheet" type="text/css" media="screen" href="fontawesome/css/font-awesome.min.css">
  14.     <script type="text/javascript" src="jquery-3.2.1.min.js"></script>
  15.  
  16. </head>
  17. <body>
  18.  
  19. <div class="slider">
  20.     <div id="fadedscreen"></div>
  21.     <div id="boxzero" class="box current"></div>
  22.     <div id="boxone" class="box waiting"></div>
  23.     <div id="boxtwo" class="box waiting"></div>
  24.     <div id="boxthree" class="box waiting"></div>
  25.     <div id="boxfour" class="box waiting"></div>
  26.  
  27.  
  28. </div>
  29.  
  30.  
  31.  
  32.  
  33. <script>
  34.     function rotateimages(){
  35.  
  36.         $(".box").css("visibility", "visible");
  37. //        $( "div.current" ).next().css( "", "red" );
  38.         var switchaxis = $(".current") ;
  39.  
  40.         var myid = switchaxis.attr("id");
  41.  
  42.  
  43.         if (myid == "boxfour"){
  44.             // we can't use next() we need to manually set the classes and
  45.             // restart the order ...
  46.             $("#boxzero").addClass("current").removeClass("waiting");
  47.             switchaxis.addClass("waiting").removeClass("current");
  48.             return ;
  49.         }
  50.  
  51. //        alert(myid);
  52.         switchaxis.next().addClass("current").removeClass("waiting");
  53.         switchaxis.removeClass("current");
  54.         switchaxis.addClass("waiting");
  55.  
  56. //        $( "div.current" ).next().addClass("current");
  57.         // note that when it gets to the lasat div element ... there are no longer any
  58.         // sibling elements to be sought by the .next() method ... so it will result in
  59.         // "undefined" ...
  60.  
  61.  
  62.     }
  63.  
  64.     $(document).ready(function(){
  65.  
  66.  
  67.         setInterval("rotateimages()", 5000);
  68.  
  69.  
  70.  
  71.  
  72.     });
  73.  
  74.  
  75.  
  76.  
  77. </script>
  78.  
  79.  
  80.  
  81. </body>
  82. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement