TEL:150-0382-3679
新闻资讯 News Center
建站知识 / 公司动态
当前窗口居中弹出div(二)

  
 <style type="text/css">
<!--
.mydiv {
background-color: #CCCCCC;
border: 0px solid #f00;
text-align: left;
line-height: 20px;
font-size: 12px;
font-weight: bold;
z-index:999;
width: 700px;

left:30%;
top:50%;
margin-left:-150px!important;/*FF IE7 该值为本身宽的一半 */
margin-top:-60px!important;/*FF IE7 该值为本身高的一半*/
margin-top:0px;
position:fixed!important;/* FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/

}

.bg,.popIframe {
background-color: #666; display:none;
width: 100%;
height: 100%;
left:0;
top:0;/*FF IE7*/
filter:alpha(opacity=90);/*IE*/
opacity:0.9;/*FF*/
z-index:1;
position:fixed!important;/*FF IE7*/
position:absolute;/*IE6*/
_top:       expression(eval(document.compatMode &&
            document.compatMode=='CSS1Compat') ?
            documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/
            document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);
}
.popIframe {
filter:alpha(opacity=0);/*IE*/
opacity:0;/*FF*/
}
-->
</style>
<script language="javascript" type="text/javascript">
function showDiv(objdiv,objfram,objbg){
document.getElementById(objdiv).style.display='block';
document.getElementById(objfram).style.display='block';
document.getElementById(objbg).style.display='block';
}
function closeDiv(objdiv,objfram,objbg){
document.getElementById(objdiv).style.display='none';
document.getElementById(objbg).style.display='none';
document.getElementById(objfram).style.display='none';

}
</script>

<asp:Repeater ID="Repeater2" runat="server">
               <ItemTemplate>
                   <div id="popDiv<%#Container.ItemIndex %>" class="mydiv" style="display: none;">
                       <div style="width: 100%; text-align: right;">
                           <a href='#riqi' style="width: 30px; text-align: center" onclick='javascript:closeDiv("popDiv<%#Container.ItemIndex %>","popIframe","bg")'>
                               X</a></div>
                       <%#Eval("product_info")%>
                   </div>
                   <div style="float: left; clear: right; width: 150px; text-align: center">
                       <img src="images/upimg/<%#Eval("pro_img") %>" onclick='javascript:showDiv("popDiv<%#Container.ItemIndex %>","popIframe","bg")'
                           width="148" height="78" />
                   </div>
               </ItemTemplate>
           </asp:Repeater>
 <div id="bg" class="bg" style="display:none;"></div>
  <iframe id='popIframe' class='popIframe' frameborder='0' ></iframe>

一站式全网营销,您身边的网络营销顾问,为您一对一私人定制符合您实际需求的网络营销实施方案!
24小时咨询热线:
150-0382-3679