大佬教程收集整理的这篇文章主要介绍了Jquery – 如何将mouseleave事件设置为after()生成div?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
那么,我该如何修复它还是有其他方法来做同样的@L_673_7@吗?
shows = $(".shows"); shows.bind('mouseenter',function() { enlargeCenter($(this),1.8,'bigger'); }); function enlargeCenter(des,ratio,nclass) { var oWidth = des.width(); var oHeight = des.height(); var nHeight = oHeight * ratio; var nWidth = oWidth * ratio; var left = des.position().left; var top = des.position().top; left = (oWidth - nWidth) / 2 - oWidth; top = (oHeight - nHeight) /2; des.after("<div class='" + nclass + "' onmouSEOut='remove()'>" + des.html() + "</div>"); $("." + nclass).css({ 'width': nWidth,'height': nHeight,'left': left,'top': top }); }
这是css代码
.shows,.bigger { float:left; width:200px; height:250px; position: relative; left:0; top:0; border:1px #ccc solid; @R_801_11442@kground: RGB(245,245,245); overflow:hidden; } .bigger { border:0; @R_801_11442@kground: white; Box-shadow: #ccc 0 0 5px; -moz-Box-shadow: #ccc 0 0 5px; -ms-Box-shadow: #ccc 0 0 5px; -webkit-Box-shadow: #ccc 0 0 5px; }
HTML
<div class="container"> <div class="shows"> <p>odfelakjfelkavjekvaelkfjjjj</p> </div> </div>
以上是大佬教程为你收集整理的Jquery – 如何将mouseleave事件设置为after()生成div?全部内容,希望文章能够帮你解决Jquery – 如何将mouseleave事件设置为after()生成div?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。