p is a link. If you move the mouse up, a p will appear, such as a view more button. How to do this?
走同樣的路,發(fā)現(xiàn)不同的人生
Just listen to the mouseenter event and then display the p or button
/* 1.css */
.more{display:none};
p:hover .more{display:block}
//2.js
$('p').hover(function(){
$('.more').show();
})
http://jsbin.com/tiqenecata/e...
html:
<p>
<p class="a">假如我是一個(gè)鏈接</p>
<p class="b">點(diǎn)我查看更多</p>
<p>
js (load jQuery library):
$(function(){
$(".b").css("display","none"); //初始化隱藏按鈕
$(".a").hover(function(){ //鼠標(biāo)移入移出函數(shù)
$(".b").css("dispaly","block") //移入顯示
},function(){
$(".b").css("dispaly","none") //移出隱藏
})
})