模态层效果
下面说说在写模态层的时候的思路:通过可配置的参数width,height,title以及content用来设定弹出的信息框显示的内容,并通过可配置参数container用来设定模态层显示的区域。思路很简单,主要是一些css样式和js处理,详见源码:
modal.css
html,body{ font-size: 12px; font-family: "微软雅黑";}.modal{ position: absolute; top:0px; left: 0px; border: 1px solid #000; background: #555; opacity: 0.4;}.infowin{ border: 1px solid #777777; background: #fff; box-shadow: 0 0 0.75em #777777; -moz-box-shadow: 0 0 0.75em #777777; -webkit-box-shadow: 0 0 0.75em #777777; -o-box-shadow: 0 0 0.75em #777777; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -o-border-radius: 5px;} .title{ border-bottom: 1px solid #777777;}.title_content{ padding: 5px; padding-left: 10px; font-size: 14px; font-family: "微软雅黑"; font-weight: bold;}.close{ background: url(close.png) no-repeat; width: 25px; height: 25px; float: right;}.close:hover{ cursor: pointer;}.content{ padding-left: 10px; padding-top: 10px;}
jquery.modal.js
(function($){ $.fn.modalInfowindow = function(options){ var defaults = {}; var options = $.extend(defaults, options); var container=$(this); var width=options.width, height=options.height, title=options.title, content=options.content; //模态层容器 var modal=$("
查看更多关于js+css实现模态层效果_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did105918