2013-03-11 72 views
0

我使用EricMarin的SimpleModal。我是没有得到modalpopup要显示correctly.I是新来使用jQuery插件,找不到在哪里出了问题jquery插件simplemodal无法正常显示?

这里的jQuery的脚本,我使用

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script> 
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.1.js"></script> 
<script type="text/javascript" src="../js/jquery.simplemodal.1.4.4.min.js"></script> 

下面是我用

<link rel="stylesheet" href="../css/simplemodal.css" /> 

这CSS中的simplemodal.css文件

#simplemodal-container a.modalCloseImg { 
background:url(/Images/x.png) no-repeat; /* adjust url as required */ 
width:25px; 
height:29px; 
display:inline; 
z-index:3200; 
position:absolute; 
top:-15px; 
right:-18px; 
cursor:pointer; 
} 
[if lt IE 7]> 
#simplemodal-container a.modalCloseImg { 
    background:none; 
    right:-14px; 
    width:22px; 
    height:26px; 
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(
     src='Images/x.png', sizingMethod='scale' 
    ); 
} 

这里是jQuery的功能我已经习惯了显示模式弹出

<script type="text/javascript"> 
    $(function() { 

     $("#btnAdd").click(function(){     
      $("#tblSession").modal(); 
     }); 
    }); 
</script> 

这是我已经习惯了显示模式弹出

<table id="tblSession" style="width:100%"> 
<tr> 
    <td> 
     <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
    </td> 
    <td> 
     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
    </td> 
</tr> 
</table> 
+0

只是出于好奇,为什么不使用'jQuery-ui' http://jqueryui.com/dialog/#modal – 2013-03-11 09:24:44

+0

删除'... src =“http://code.jquery.com/jquery -1.10.1.js“> ...'。您尝试使用2个不同的jQuery版本。 – Eich 2013-03-11 09:25:54

+0

一个是jqueryui,另一个是jquery.Are他们一样吗?他们用在[jquery选项卡](http://jqueryui.com/tabs/)。如果我错了,很抱歉 – Kannan 2013-03-11 09:57:00

回答

0

至于你的代码提供的表格,我认为你应该通过在其上加入.hide { display: none }类来隐藏表格,然后你需要做的就是运行模态。

Example here

此外,@da_re说你不应该添加jQuery的两倍。无论如何,这是一个旧版本,不再可用。

+0

Thankyou非常适合您的答案。 – Kannan 2013-03-11 10:10:19

+0

我很高兴我可以帮助:) – agriboz 2013-03-11 10:20:28