Browse Source

use wrap div with dynamic resizing

Thomas Buck 3 years ago
parent
commit
d5d010b94b
2 changed files with 9 additions and 8 deletions
  1. 7
    2
      page.html
  2. 2
    6
      static/css/style.css

+ 7
- 2
page.html View File

24
             print page.github
24
             print page.github
25
             print '">Fork me on GitHub</a></div></div>'
25
             print '">Fork me on GitHub</a></div></div>'
26
     %-->
26
     %-->
27
-    <div id="nav">
27
+    <div id="wrap"><div id="nav">
28
         <ul>
28
         <ul>
29
             <li id="home"><a href="index.html">xythobuz.de</a></li>
29
             <li id="home"><a href="index.html">xythobuz.de</a></li>
30
             <!--%
30
             <!--%
52
                     print "</li>"
52
                     print "</li>"
53
             %-->
53
             %-->
54
         </ul>
54
         </ul>
55
-    </div>
55
+    </div></div>
56
     <div id="content">
56
     <div id="content">
57
         <!--%
57
         <!--%
58
             from datetime import datetime
58
             from datetime import datetime
137
             print '</script>'
137
             print '</script>'
138
     %-->
138
     %-->
139
     <script type="text/javascript">
139
     <script type="text/javascript">
140
+        jQuery(window).resize(function() {
141
+            $('#wrap').css('height', $('#nav').css('height'));
142
+        });
140
         $(document).ready(function(){
143
         $(document).ready(function(){
144
+            $('#wrap').css('height', $('#nav').css('height'));
145
+
141
             var fontSize = parseInt($('body').css('font-size'), 10);
146
             var fontSize = parseInt($('body').css('font-size'), 10);
142
             var initialFontSize = fontSize;
147
             var initialFontSize = fontSize;
143
             $('.inc').on('click', function() {
148
             $('.inc').on('click', function() {

+ 2
- 6
static/css/style.css View File

30
         left: 0;
30
         left: 0;
31
     }
31
     }
32
 
32
 
33
-    #content {
34
-        padding-top: 5em;
35
-    }
36
-
37
-    #index-avatar {
38
-        margin-top: 1.5em;
33
+    #wrap {
34
+        height: 5em;
39
     }
35
     }
40
 }
36
 }
41
 
37
 

Loading…
Cancel
Save