p is a link. If you move the mouse up, a p will appear, such as a view more button. How to do this?
走同样的路,发现不同的人生
Just listen to the mouseenter event and then display the p or button
Use css for hover
css
hover
/* 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">假如我是一个链接</p> <p class="b">点我查看更多</p>
<p>
js (load jQuery library):
$(function(){
$(".b").css("display","none"); //初始化隐藏按钮 $(".a").hover(function(){ //鼠标移入移出函数 $(".b").css("dispaly","block") //移入显示 },function(){ $(".b").css("dispaly","none") //移出隐藏 })
})
Just listen to the mouseenter event and then display the p or button
Use
css
forhover
http://jsbin.com/tiqenecata/e...
html:
<p>
<p>
js (load jQuery library):
$(function(){
})