1
我在我的頁面頂部有一個欄,但是當我第一次加載頁面時,欄覆蓋了頁眉。當我點擊右側的隱藏條箭頭時,會顯示標題,然後當我單擊再出現的箭頭時,邊距會自動調整大小,以便標題位於條的下方。頁面頂部的頁邊不正確?
我似乎無法解決爲什麼當頁面加載時,欄不會自動創建頁邊距?任何想法...這是我使用的JavaScript和代碼。該網站也http://www.brightonorient.com
任何幫助將非常感謝!
<script type="text/javascript">
var stub_showing = false;
function woahbar_show() {
if(stub_showing) {
$('.woahbar-stub').slideUp('fast', function() {
$('.woahbar').show('bounce', { times:3, distance:15 }, 100);
$('body').animate({"marginTop": "2.4em"}, 250);
});
}
else {
$('.woahbar').show('bounce', { times:3, distance:15 }, 100);
$('body').animate({"marginTop": "2.4em"}, 250);
}
}
function woahbar_hide() {
$('.woahbar').slideUp('fast', function() {
$('.woahbar-stub').show('bounce', { times:3, distance:15 }, 100);
stub_showing = true;
});
if($(window).width() > 1024) {
$('body').animate({"marginTop": "0px"}, 250); // if width greater than 1024 pull up the body
}
}
$().ready(function() {
window.setTimeout(function() {
woahbar_show();
}, 5000);
});
</script>
<div class="woahbar">
<span>
Brighton Orient treats you to up to 25% off in honour of Mother's day! Ends midnight this Sunday, 18 March!! <a class="woahbar-link" href="http://www.brightonorient.com/events.html">Click here for details</a>
</span>
<a class="close-notify" onclick="woahbar_hide();"><img class="woahbar-up-arrow" src="woahbar-up-arrow.png"></a>
</div>
<div class="woahbar-stub" style="display:none">
<a class="show-notify" onclick="woahbar_show();"><img class="woahbar-down-arrow" src="woahbar-down-arrow.png"></a>
</div>
謝謝你,這是正確的,不幸的是,jquery與我的cufon字體渲染髮生衝突,所以目前它只是固定不動畫,直到我找出衝突是什麼。 – Jeremy 2012-03-15 10:20:40
不要使用cufon。又一個臃腫的東西要打破。 – James 2012-12-26 05:28:23