Team:Hong Kong-CUHK/home.html
From 2014.igem.org
(Difference between revisions)
m |
|||
Line 345: | Line 345: | ||
function getWindowWidth() { | function getWindowWidth() { | ||
- | + | if (document.documentElement) { | |
- | if (document.documentElement | + | if (document.documentElement.clientWidth) { |
- | + | return document.documentElement.clientWidth; | |
- | + | ||
- | if (document. | + | |
- | + | ||
} | } | ||
} | } | ||
- | return | + | |
+ | if (document.body && document.body.clientWidth) { | ||
+ | return document.body.clientWidth; | ||
+ | } else { | ||
+ | return 0; | ||
+ | } | ||
} | } | ||
Line 383: | Line 385: | ||
$("#traffic-light").hide(); | $("#traffic-light").hide(); | ||
} | } | ||
- | + | ||
$('.content-wrapper').css({ | $('.content-wrapper').css({ | ||
'left': Math.min($(this).scrollLeft(), $('.navbar').width() - getWindowWidth()) | 'left': Math.min($(this).scrollLeft(), $('.navbar').width() - getWindowWidth()) |
Revision as of 16:44, 17 October 2014