我發現這個代碼無法實現的JavaScript代碼
$(window).scroll(function(){
$('#header').css({
//Why this 15, because in the CSS, we have set left 15, so as we scroll, we would want this to remain at 15px left
'left': $(this).scrollLeft() + 15
});
});
而且它正是我需要的,但我不知道如何實現它在我的HTML或CSS。誰能幫我嗎?我真的很感激它。
你可以發佈你的HTML嗎? – honyovk 2012-07-05 15:36:44
如果它滿足你的需求,你卡在哪裏? – 2012-07-05 15:36:50
看看包含Javascript的_any_頁面,看看它是如何完成的? – TheZ 2012-07-05 15:36:52