Forráskód Böngészése

新增固定選單功能

jeter20131220 3 éve
szülő
commit
cfb959c306
5 módosított fájl, 51 hozzáadás és 15 törlés
  1. 9 2
      about/about.css
  2. 0 0
      about/about.css.map
  3. 8 3
      about/about.scss
  4. 27 3
      about/goto2.js
  5. 7 7
      goto.js

+ 9 - 2
about/about.css

@@ -21,10 +21,10 @@ body {
 body .arrow {
   position: fixed;
   right: 30px;
-  bottom: 150px;
+  top: 500px;
   width: 45px;
   height: 40px;
-  z-index: 10;
+  z-index: 20;
 }
 
 body .arrow a {
@@ -72,6 +72,13 @@ body .arrow:hover {
   }
 }
 
+#Navigation .sfixed {
+  position: fixed;
+  top: 50px;
+  z-index: 10;
+  background: #000;
+}
+
 #Navigation #nav {
   width: 100vw;
   margin: 0 auto;

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
about/about.css.map


+ 8 - 3
about/about.scss

@@ -24,10 +24,10 @@ body {
     .arrow {
         position: fixed;
         right: 30px;
-        bottom: 150px;
+        top:500px;
         width: 45px;
         height: 40px;
-        z-index: 10;
+        z-index: 20;
         a{
             margin: 30px 0px;
         }
@@ -64,7 +64,12 @@ body {
 
         background: rgba(0, 0, 0, 0.8);
     }
-
+    .sfixed{
+        position:fixed;
+        top: 50px;
+        z-index: 10;
+        background: #000;
+    }
     #nav {
         width: 100vw;
         margin: 0 auto;

+ 27 - 3
about/goto2.js

@@ -243,14 +243,38 @@ $(document).ready(function () {
 
 });
 
-$(".arrow").hide();
+// $(".arrow").hide();
 $(window).scroll(function () {
     var y = window.scrollY;
-
-    if (y > 1) {
+    if (y > 500) {
         $(".arrow").show();
     } else {
         $(".arrow").hide();
     }
 
 });
+
+
+// $(window).scroll(function () {
+//     var y = window.scrollY;
+
+//     if (y > 550) {
+//         $(".nav").addClass("sfixed");
+//     } else {
+//         $(".nav").removeClass("sfixed");
+//     }
+
+// });
+if (jQuery(window).width() < 767) {
+
+    $(window).scroll(function () {
+        var y = window.scrollY;
+    
+        if (y > 550) {
+            $(".nav").css({"position":"fixed","top":"55px","width":"96vw","margin":"0 auto","z-index":"10"});
+        } else {
+            $(".nav").css({"position":"static","margin":"10px 0px"});
+        }
+    
+    });
+}

+ 7 - 7
goto.js

@@ -278,10 +278,10 @@ $('#491').click(function () {
 
 
 
-// $("div.sec01-designer div").sort(function(){
-//   return Math.random()*10 > 5 ? 1 : -1;
-// }).each(function(){
-//   var $t = $(this),
-//       color = $t.attr("");
-//   $t.css({backgroundColor: color}).appendTo( $t.parent() );
-// });
+$("div.sec01-designer div").sort(function(){
+  return Math.random()*10 > 5 ? 1 : -1;
+}).each(function(){
+  var $t = $(this),
+      color = $t.attr("");
+  $t.css({backgroundColor: color}).appendTo( $t.parent() );
+});

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott