Permalink
Browse files

change some script and add a style for efficiency

  • Loading branch information...
1 parent ec165c2 commit 5a430d02d24950a67533013208c98a3f4b6bf310 @OuZhencong committed Mar 8, 2012
Showing with 9 additions and 5 deletions.
  1. +6 −0 css/style.css
  2. +3 −5 topbar.html
View
6 css/style.css
@@ -22,6 +22,12 @@ h1 {
font-size: 2em;
}
+.fix {
+ position: fixed;
+ left: 0px;
+ right: 0px;
+}
+
#header {
height: 100px;
width: 100%;
View
8 topbar.html
@@ -13,11 +13,9 @@
var navContent = doc.getElementById('content');
var elemStyle = topBar.style;
if(y > 150) {
- if(elemStyle.position != 'fixed') {
+ if(topBar.className != 'fix') {
- elemStyle.position = 'fixed';
- elemStyle.left = '0px';
- elemStyle.right = '0px';
+ topBar.className = 'fix';
navTips.style.display = 'none';
navContent.style.display = 'block';
@@ -34,7 +32,7 @@
}
}
if (y < 100) {
- elemStyle.position = '';
+ topBar.className = '';
navContent.style.display = 'none';
navTips.style.display = 'block';
}

0 comments on commit 5a430d0

Please sign in to comment.