欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery實(shí)現(xiàn)鼠標(biāo)移入顯示蒙版效果

 更新時(shí)間:2020年01月11日 11:18:22   作者:fengzhen8023  
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)鼠標(biāo)移入顯示蒙版效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了jQuery鼠標(biāo)移入顯示蒙版的具體代碼,供大家參考,具體內(nèi)容如下

效果展示:

具體代碼:

<ul id="fourth_tab">
  <li>
   <img src="img/camera_green.png" alt="綠色相機(jī)" class="camera">
   <p class="title"><span>攝影小白成長(zhǎng)記</span></p>
   <p>The best preparation for tomorrow is doing your best today.</p>
  </li>
  <li style="background-color: red">
   <div class="show_more"><a href="html/test.html" >點(diǎn)擊查看更多</a></div>
   <img src="img/bus.webp" alt="公交車(chē)">
  </li>
  <li style="background-color: red">
   <div class="show_more"><a href="html/test.html" >點(diǎn)擊查看更多</a></div>
   <img src="img/life.png" alt="落葉">
  </li>
 </ul>
#fourth_tab li{
 position: relative;
 border-radius: 6px;
}
.show_more{
 width: 100%;
 height: 100%;
 line-height: 230px;
 background-color: #9f594d;
 position: absolute;
 display: none;
 font-size: 22px;
 font-weight: bolder;
 letter-spacing: 4px;
 cursor: pointer;
}
.show_more a{
 text-decoration: none;
 color: #fbfff9;
}
$('#fourth_tab li').mouseenter(function(){
 $(this).find('.show_more').slideDown(200);
});

$('#fourth_tab li').mouseleave(function(){
 $(this).find('.show_more').slideUp(200);
});

個(gè)人筆記:

1.這里主要使用到j(luò)Query的slideUp()、slideDown()函數(shù)
2.在js代碼中,使用$(this)來(lái)做限制。鼠標(biāo)移入第二張圖片,那么這張圖片上面顯示蒙版,其他的圖片不顯示

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論