change something

This commit is contained in:
Viggo
2017-12-20 17:40:51 +08:00
parent 8f45d09936
commit becda27777

View File

@@ -48,7 +48,7 @@
<!-- add class "multiple-expanded" to allow multiple submenus to open --> <!-- add class "multiple-expanded" to allow multiple submenus to open -->
<!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" --> <!-- class "auto-inherit-active-class" will automatically add "active" class for parent elements who are marked already with class "active" -->
<li> <li>
<a href="#DesignStackTag"> <a href="#项目1" class="smooth">
<i class="linecons-cog"></i> <i class="linecons-cog"></i>
<span class="title">Chiness</span> <span class="title">Chiness</span>
</a> </a>
@@ -60,8 +60,8 @@
</li> </li>
<li> <li>
<a href="#项目2" class="smooth"> <a href="#项目2" class="smooth">
<span class="title smooth">Update Highlights</span> <span class="title">Update Highlights</span>
<span class="label label-pink pull-right hidden-collapsed">v1.3</span> <span class="label label-pink pull-right hidden-collapsed">Hot</span>
</a> </a>
</li> </li>
</ul> </ul>
@@ -77,19 +77,39 @@
<span class="title">Layout Variants &amp; API</span> <span class="title">Layout Variants &amp; API</span>
</a> </a>
</li> </li>
<li>
<a href="#DesignStackTag">
<span class="title">Layout Variants2 &amp; API</span>
</a>
</li>
<li>
<a href="#DesignStackTag">
<span class="title">Layout Variants3 &amp; API</span>
</a>
</li>
</ul> </ul>
</li> </li>
<li> <li>
<a href="#DesignStackTag"> <a href="#项目4">
<i class="linecons-note"></i> <i class="linecons-note"></i>
<span class="title">UI Elements</span> <span class="title">UI Elements</span>
</a> </a>
<ul> <ul>
<li> <li>
<a href="#DesignStackTag"> <a href="#项目4" class="smooth">
<span class="title">Other Elements</span> <span class="title">Other Elements</span>
</a> </a>
</li> </li>
<li>
<a href="#DesignStackTag">
<span class="title">Layout Variants5 &amp; API</span>
</a>
</li>
<li>
<a href="#DesignStackTag">
<span class="title">Layout Variants6 &amp; API</span>
</a>
</li>
</ul> </ul>
</li> </li>
</ul> </ul>
@@ -781,29 +801,33 @@
</div> </div>
<!-- 锚点平滑移动 --> <!-- 锚点平滑移动 -->
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { // $(document).ready(function() {
$("a.smooth").click(function() { // $("#main-menu li ul li").click(function() {
$("html, body").animate({ // $(this).siblings('li').removeClass('active'); // 删除其他兄弟元素的样式
scrollTop: $($(this).attr("href")).offset().top + "px" // $(this).addClass('active'); // 添加当前元素的样式
}, { // });
duration: 500, // $("a.smooth").click(function() {
easing: "swing" // $("html, body").animate({
}); // scrollTop: $($(this).attr("href")).offset().top - 30
return false; // }, {
}); // duration: 500,
// 给点击元素添加active类 // easing: "swing"
$("smooth").click(function(e) { // });
$("smooth").each(function() { // });
$(this).removeClass("active"); // return false;
}); // });
$(this).parent("a").addClass("active");
e.preventDefault(); var href = "";
href = $(this).attr("href"); var pos = 0;
pos = $(href).position().top - 30; $("a.smooth").click(function(e) {
$("html,body").animate({ $("#main-menu li").each(function() {
scrollTop: pos $(this).removeClass("active");
}, 500);
}); });
$(this).parent("li").addClass("active");
e.preventDefault();
href = $(this).attr("href");
pos = $(href).position().top - 30;
$("html,body").animate({ scrollTop: pos }, 500);
}); });
</script> </script>
<!-- Bottom Scripts --> <!-- Bottom Scripts -->