jquery實現(xiàn)盒子下拉效果示例代碼
更新時間:2013年09月12日 17:27:28 作者:
當(dāng)把鼠標(biāo)移動到盒子上的時候上面就會出現(xiàn)一個黑色的盒子,這是在瀏覽網(wǎng)頁的時候看到的一個效果,具體實現(xiàn)如下,感興趣的朋友可以了解下
復(fù)制代碼 代碼如下:
<script src="js/Jquery1.7.js"></script>
<script type="text/javascript">
$(function () {
$('div:eq(1)').css({ 'margin-top': '-=100px' });
$('div:first').mouseover(function () {
$('div:eq(1)').animate({'margin-top':'+=100px'});
})
$('div:first').mouseout(function () {
$('div:eq(1)').animate({ 'margin-top': '-=100px' });
})
</script>
復(fù)制代碼 代碼如下:
<pre name="code" class="html"><div style="width:600px;height:300px;overflow:hidden;">
<div style="background-color:#000;height:100px;">
</div>
<div style="background-color:#eee;height:300px;">
</div>
</div></pre><br>
<pre></pre>
<pre name="code" class="html"></pre><pre name="code" class="html">當(dāng)把鼠標(biāo)移動到盒子上的時候上面就會出現(xiàn)一個黑色的盒子</pre><pre name="code" class="html">這是在瀏覽網(wǎng)頁的時候看到的一個效果</pre><pre name="code" class="html">在這里寫了一下</pre>
相關(guān)文章
javascript中對Attr(dom中屬性)的操作示例講解
這篇文章主要是對javascript中對Attr(dom中屬性)的操作進(jìn)行了詳細(xì)的介紹,需要的朋友可以過來參考下,希望對大家有所幫助2013-12-12jQuery制作簡潔的多級聯(lián)動Select下拉框
省市多級聯(lián)動的select下拉框有很多種實現(xiàn)方式,度娘上隨便一搜就一大堆,今天我們來討論的這款特效,代碼卻很簡潔,兼容性也非常棒,推薦給大家。2014-12-12Jquery倒數(shù)計時按鈕setTimeout的實例代碼
這篇文章介紹了Jquery倒數(shù)計時按鈕setTimeout的實例,有需要的朋友可以參考一下2013-07-07