我想使用简单的模式插件将一个变量传递到我的 javascript 中,http://www.ericmmartin.com/projects/simplemodal/ , .click 函数在我的 View 中 (html) ... 这是我的 javascript:
$('#basic-modal .basic').click(function (e) {
var src = "http://365.ericmmartin.com/"
$.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
});
return false;
});
这是我在 html 中尝试的内容:
%a.basic{:href => "#", :onclick => 'var src = "http://somesite.com/"'}
最佳答案
Jquery Dialog已经为您构建了这个确切的功能。我强烈建议您尝试这种方法:
关于javascript - jquery点击简单模态插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7366157/