Skip to content

Commit

Permalink
加入导航动画
Browse files Browse the repository at this point in the history
Signed-off-by: Jayin Ton <[email protected]>
  • Loading branch information
Jayin committed Oct 25, 2014
1 parent 4806ac1 commit c42092f
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ function init() {
}
```

### 导航栏动画
//注释掉下面的可以删除该动画
```html
<!-- 可选的动画 -->
<script src="vendor/anim.js"></script>
```

License
===
Copyright 2014 Meizhuo Lib
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
<script src="vendor/jquery-1.11.1.min.js"></script>
<script src="vendor/marked-0.3.2.min.js"></script>
<script src="vendor/blog.js"></script>
<!-- 可选的动画 -->
<script src="vendor/anim.js"></script>

<!-- code highlight-->
<script src="vendor/highlight/highlight.pack.js"></script>
Expand Down
24 changes: 24 additions & 0 deletions p/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,30 @@ e.g:
</div>
```

**如果想在网站首页不显示评论,如何做?**
```javascript
//blog.js
function init() {
read_config(function() {
load('#sidebar-page', 'sidebar.md', true);

if (cur_md_path === '') {
load('#main-page', 'home.md');
console.log("load main~");
//多说评论,若想不在首页显示评论框 那么:取消这一句注释
//$('.ds-thread').removeClass('ds-thread');
}
});
}
```

### 导航栏动画
//注释掉下面的可以删除该动画
```html
<!-- 可选的动画 -->
<script src="vendor/anim.js"></script>
```

License
===
Copyright 2014 Meizhuo Lib
Expand Down
26 changes: 26 additions & 0 deletions vendor/anim.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* 可选的动画
*/

(function($) {

var $sidebar_page = $('.sidebar-page');

$sidebar_page.on('mouseenter', 'li', function() {
console.log('mouseenter');
$(this).animate({
fontSize: "120%",
paddingLeft: "+=10px"
}, 0);

});

$sidebar_page.on('mouseleave', 'li', function() {
console.log('mouseleave');
$(this).animate({
fontSize: "100%",
paddingLeft: "-=10px"
}, 0);
});

})(jQuery);
2 changes: 1 addition & 1 deletion vendor/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ blockquote {
text-decoration: none;
}
.sidebar-inner li {
padding-top: 4px;
padding-top: 12px;
}
.sidebar a {
color: #fff;
Expand Down

0 comments on commit c42092f

Please sign in to comment.