站长资源网络编程

jQuery实现的两种简单弹窗效果示例

整理:jimmy2026/7/31浏览2
简介本文实例讲述了jQuery实现的两种简单弹窗效果。分享给大家供大家参考,具体如下:这里利用jquery实现两种弹窗效果:1. 淡入弹窗效果:www.jb51.net jQuery弹窗</div> <div class="news_infos"><div id="MyContent"><p>本文实例讲述了jQuery实现的两种简单弹窗效果。分享给大家供大家参考,具体如下:</p> <p>这里利用jquery实现两种弹窗效果:</p> <p><strong>1. 淡入弹窗效果:</strong></p> <div class="htmlcode"> <pre class="brush:js;"> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>www.jb51.net jQuery弹窗</title> <style> *{padding: 0;margin: 0;} .box{width: 100%;height: 100%;} .main{width: 100%;height: 100%;background-color: rgba(0,0,0,0.8);display: none;position: fixed;z-index: 1;} .mainbox{width: 800px;height: 100%;margin: 0 auto;background-color: rgba(255,255,255,0.8);padding: 20px;} .kkk{width: 100%;height: 1200px;background-color: red;} .close{color: red;cursor: pointer;} </style> <script src="/UploadFiles/2021-04-02/jquery.min.js"> <p>运行效果:</p> <p><a href="javascript:;" onclick="showimg('/UploadFiles/2021-04-02/201841894913243.gif');"><img src="/UploadFiles/2021-04-02/201841894913243.gif" alt="jQuery实现的两种简单弹窗效果示例" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a></p> <p><strong>2. 滑动弹窗效果:</strong></p> <div class="htmlcode"> <pre class="brush:js;"> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>www.jb51.net jQuery弹窗</title> <style> *{padding: 0;margin: 0;} .box{width: 100%;height: 100%;} .main{width: 100%;height: 100%;background-color: rgba(0,0,0,0.8);display: none;position: fixed;z-index: 1;} .mainbox{width: 800px;height: 100%;margin: 0 auto;background-color: rgba(255,255,255,0.8);padding: 20px;display: none;} .kkk{width: 100%;height: 1200px;background-color: red;} .close{color: red;cursor: pointer;} </style> <script src="/UploadFiles/2021-04-02/jquery.min.js"> <p>运行效果:</p> <p><a href="javascript:;" onclick="showimg('/UploadFiles/2021-04-02/201841895313766.gif');"><img src="/UploadFiles/2021-04-02/201841895313766.gif" alt="jQuery实现的两种简单弹窗效果示例" onmousewheel="return bbimg(this)" onload="javascript:resizepic(this)" border="0"/></a></p> <p>更多关于jQuery相关内容感兴趣的读者可查看本站专题:《jQuery窗口操作技巧总结》、《jQuery扩展技巧总结》、《jQuery常用插件及用法总结》、《jQuery表格(table)操作技巧汇总》、《jQuery常见经典特效汇总》及《jquery选择器用法总结》</p> <p>希望本文所述对大家jQuery程序设计有所帮助。</p></div> </div> </div> <div class="share"> </div> <div class="nextinfo"> <p>上一篇:<a href="/3g/1/92338.html" title="详解webpack-dev-server 设置反向代理解决跨域问题">详解webpack-dev-server 设置反向代理解决跨域问题</a></p> <p>下一篇:<a href="/3g/1/92340.html" title="vue双向数据绑定知识点总结">vue双向数据绑定知识点总结</a></p> </div> <div class="otherlink"> <h2>最新资源</h2> <ul> <li><a href="/3g/1/623703.html" title="群星《奔赴!万人现场 第2期》[FLAC/分轨]">群星《奔赴!万人现场 第2期》[FLAC/分轨]</a></li> <li><a href="/3g/1/623702.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/3g/1/623701.html" title="群星《奇妙浪一夏 (上海迪士尼度假区音乐">群星《奇妙浪一夏 (上海迪士尼度假区音乐</a></li> <li><a href="/3g/1/623700.html" title="【古典音乐】詹姆斯·高威《季节》1993[WA">【古典音乐】詹姆斯·高威《季节》1993[WA</a></li> <li><a href="/3g/1/623699.html" title="贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]">贝拉芳蒂《卡里普索之王》SACD[WAV+CUE]</a></li> <li><a href="/3g/1/623698.html" title="小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE">小骆驼-《草原狼2(蓝光CD)》[原抓WAV+CUE</a></li> <li><a href="/3g/1/623697.html" title="群星《欢迎来到我身边 电影原声专辑》[32">群星《欢迎来到我身边 电影原声专辑》[32</a></li> <li><a href="/3g/1/623696.html" title="群星《欢迎来到我身边 电影原声专辑》[FL">群星《欢迎来到我身边 电影原声专辑》[FL</a></li> <li><a href="/3g/1/623695.html" title="雷婷《梦里蓝天HQⅡ》 2023头版限量编号低">雷婷《梦里蓝天HQⅡ》 2023头版限量编号低</a></li> <li><a href="/3g/1/623694.html" title="群星《2024好听新歌42》AI调整音效【WAV分">群星《2024好听新歌42》AI调整音效【WAV分</a></li> </ul> </div> </div> <div class="sidebar"> </div> <div class="sidebar"> 友情链接:<a href="http://www.imxmx.com/" title="杰晶网络" target="_blank">杰晶网络</a> <a href="/" title="DDR爱好者之家" target="_blank">DDR爱好者之家</a> <a href="http://www.nqxw.com/" title="南强小屋" target="_blank">南强小屋</a> <a href="http://www.paidiu.com/" title="黑松山资源网" target="_blank">黑松山资源网</a> <a href="http://www.dyhadc.com/" title="白云城资源网" target="_blank">白云城资源网</a> <a href="/sitemap1.xml">站点地图</a> <a href="/sitemap.xml">SiteMap</a> </div> </article> <footer> <p>Design by <a href="http://m.ddrfans.com">DDR爱好者之家</a> <a href="http://m.ddrfans.com">http://m.ddrfans.com</a></p> </footer> <script src="/images3g/nav.js"></script> <script type="text/javascript"> jQuery.noConflict(); jQuery(function() { var elm = jQuery('#left_flow2'); var startPos = jQuery(elm).offset().top; jQuery.event.add(window, "scroll", function() { var p = jQuery(window).scrollTop(); jQuery(elm).css('position', ((p) > startPos) ? 'fixed' : ''); jQuery(elm).css('top', ((p) > startPos) ? '0' : ''); }); }); </script> </body> </html>