自定义popup弹出框-创新互联

ys_popup.css

创新互联公司网站建设公司,提供成都做网站、网站制作,网页设计,建网站,PHP网站建设等专业做网站服务;可快速的进行网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,是专业的做网站团队,希望更多企业前来合作!.ys-popup{     position:fixed;     top:0;     bottom:0;     left:0;     right:0;     display:none;     z-index: 99999;     background-color: rgba(0,0,0,0.4); } .ys-popup .ys-popup-content{     position:absolute;     left:30px;     right:30px;     top:50%;     display:block;     background-color:#fff;     margin:auto;     border-radius: 4px; }

ys_popup.js

(function($){     function closePopup(target){         $(target).hide();     }     function showPopup(target){         $(target).show();         $(target).css("visibility","hidden");         var popupContentHeight = parseInt($(target).find(".ys-popup-content").css("height"));         $(target).find(".ys-popup-content").css({             "margin-top":(-1)*popupContentHeight/2+"px"         });         $(target).css("visibility","initial");     }     $("body").on("click",".ys-popup",function(e){         e.stopPropagation();         e.preventDefault();         $(this).hide();     });     $("body").on("click",".ys-popup .ys-popup-content",function(e){         e.stopPropagation();         e.preventDefault();     });     var options = {         ysPopup:function(command) {             if(command=="show"){                 showPopup(this);             }else if(command=="hide"){                 closePopup(this);             }else{                 showPopup(this);             }         }     };     $.fn.extend(options); })(jQuery);

测试

    <div class="ys-popup remark-popup" >         <div class="ys-popup-content">             <div class="remark-popup-title">备注</div>             <div class="remark-popup-content"><textarea placeholder="请输入备注"></textarea></div>             <div class="remark-popup-btn-group clearfix">                 <a class="remark-popup-cancel">取消</a>                 <a class="remark-popup-ok">确认</a>             </div>         </div>     </div><!-- activity-success-popup --> <script> $(".ys-popup").ysPopup("show");// 显示弹出框 $(".ys-popup").ysPopup("hide");// 隐藏弹出框 </script>

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。

网页题目:自定义popup弹出框-创新互联
URL链接:https://www.cdcxhl.com/article36/ioesg.html

成都网站建设公司_创新互联,为您提供营销型网站建设全网营销推广关键词优化ChatGPT小程序开发品牌网站设计

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都seo排名网站优化