-2
我有一個網頁,並且當用戶在任何點滾動時,我想要一個div標籤將其類從「頂部」更改爲「頂部滾動」。用戶在網頁上滾動後將類添加到<body>
我認爲你必須使用.scrollTop()來做到這一點,但不太清楚如何使用它。下面是HTML代碼
<div class="thetop">
<?php /** Begin Header **/ if ($gantry->countModules('header')) : ?>
<div id="rt-header">
<div class="rt-container">
<?php echo $gantry->displayModules('header','standard','standard'); ?>
<div class="clear"></div>
</div>
</div>
<?php /** End Header **/ endif; ?>
</div>
我也想包括body標籤「滾動」用戶已經滾動到應用單獨的CSS樣式命名的類。
爲什麼我downvoted這個問題:http://meta.stackexchange.com/a/149138/133242 – 2013-04-05 04:12:39