OSDN Git Service

jQuery scroll
authoryamat0jp <yamat0jp@yahoo.co.jp>
Mon, 11 Sep 2017 08:38:13 +0000 (17:38 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Mon, 11 Sep 2017 08:38:13 +0000 (17:38 +0900)
static/css/top.css
static/js/top.js
templates/top.htm

index 5a8a602..d7cde8c 100644 (file)
@@ -1,8 +1,8 @@
 
 .slideshow {
-       width:200px;
-       height:400px;
-       display:inline-block;
+       background-color:rgb(50,50,50);
+       height:465px;
+       min-width:960px;
        border: solid 1px black;
        outline-style:dotted;
        overflow:hidden;
@@ -29,7 +29,7 @@
 
 .slideshow-nav a:before,
 .slideshow-indicator a:before {
-       content:url(static/img/sprites.png);
+       content:url(../img/sprites.png);
        display:inline-block;
        font-size:0;
        line-height:0
        position:static
 }
 
-.no-js .slideshow-slides .slide .box {
+.no-js .slideshow-slides .slide .box{
        margin:auto;
        position:static
 }
index bf912d8..1a7be90 100644 (file)
@@ -19,6 +19,7 @@ $(function(){
                        $(this).css({left:100*i+'%'});
                        indicatorHTML += '<a href="#">'+(i+1)+'</a>';
                });
+               
                $indicator.html(indicatorHTML);
                
                
@@ -33,15 +34,15 @@ $(function(){
                                $navNext = $nav.find('.next');
                        if (currentIndex === 0){
                                $navPrev.addClass('disabled');
-                       }else{
+                       } else {
                                $navPrev.removeClass('disabled');
                        }
                        if (currentIndex === slideCount-1){
                                $navNext.addClass('disabled');
-                       } else{
+                       } else {
                                $navNext.removeClass('disabled');
                        }
-                       $indecator.find('a').removeClass('active')
+                       $indicator.find('a').removeClass('active')
                                .eq(currentIndex).addClass('active');
                }
                
@@ -60,9 +61,9 @@ $(function(){
                
                $nav.on('click','a',function(event){
                        event.preventDefault();
-                       if ($(this).hasClass('Prev')){
+                       if ($(this).hasClass('prev')){
                                goToSlide(currentIndex-1);
-                       }else{
+                       } else {
                                goToSlide(currentIndex+1);
                        }
                });
@@ -74,15 +75,17 @@ $(function(){
                        }
                });
                
+               /*
                $container.on({
-                       mouseenter:stopTimer,
-                       mouseleave:startTimer
+                       'mouseenter':stopTimer(),
+                       'mouseleave':startTimer()
                });
-               
+               */
+
                goToSlide(currentIndex);
-               
-               startTimer();
-       });
        
+               startTimer();   
+       
+       });
        
-});
\ No newline at end of file
+});
index e61ad46..e75983d 100755 (executable)
@@ -4,7 +4,7 @@
        <meta charset=utf-8 name="google-site-verification"  content="5KOTJTKv1HgTtIt0zVGzuyAkADCwXRme-RiiKJ03l3s" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>Top Page</title> 
-       <link rel=stylesheet href={{static_url('css/top.css')}}>
+       <link rel=stylesheet href='static/css/top.css'>
        <link rel=stylesheet href={{static_url('css/normalize.css')}}>
        <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js></script>   
        <script src={{static_url('js/top.js')}}></script>