中的简单模式
我正在尝试从 :
<td><a href="games/BG-1001.php" class ="simple_modal" >EU-ch U12</a></td>
和 http://chesstao.com/test-1 的底部 传递到 simplemodal 的链接.php 我有用于获取 URL 和加载 iframe 的代码(但已被注释掉)。
<script src="js/jquery.simplemodal-1.4.1-min.js"></script>
<script src="js/basic-min.js"></script>
<script>
// Display an external page using an iframe
//var src = "http://365.ericmmartin.com/";
$("a").attr("href")
$('.simple_modal').click(function() {
var hrefval= $(this).attr("href");
});
//$.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">', {
//closeHTML:"", containerCss:{backgroundColor:"#fff", borderColor:"#fff",
//height:450, padding:0, width:830}, overlayClose:true}); </script>
问题是我无法使用文字来设置 src: var src = "http://365.ericmmartin.com/"; //DW
因为表数据中的URL发生变化。
有人可以告诉我如何将注释代码与其他代码混合吗?我的评估正确吗?
I am trying pass links to simplemodal from :
<td><a href="games/BG-1001.php" class ="simple_modal" >EU-ch U12</a></td>
and at the bottom of http://chesstao.com/test-1.php I have code for picking up the URL and for loading the iframe (but it is commented out).
<script src="js/jquery.simplemodal-1.4.1-min.js"></script>
<script src="js/basic-min.js"></script>
<script>
// Display an external page using an iframe
//var src = "http://365.ericmmartin.com/";
$("a").attr("href")
$('.simple_modal').click(function() {
var hrefval= $(this).attr("href");
});
//$.modal('<iframe src="' + src + '" height="450" width="830" style="border:0">', {
//closeHTML:"", containerCss:{backgroundColor:"#fff", borderColor:"#fff",
//height:450, padding:0, width:830}, overlayClose:true}); </script>
The problem is that I can't use a literal to set src:
var src = "http://365.ericmmartin.com/"; //DW
because the URL in the table data changes.
Can somebody please tell me how to blend the commented code with the other code?. Am I correct in my assessment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单地从点击事件内部调用
modal()
方法怎么样?这是一个简化的 JSFiddle 演示
How about simply calling the
modal()
method from inside your click event?Here is a simplified JSFiddle demo