Jquery simplemodal直接<;部门>;不带iframe

Jquery simplemodal直接<;部门>;不带iframe,jquery,simplemodal,Jquery,Simplemodal,我之前有一篇关于SimpleModel和iframe的帖子 但是现在我想调用div而不是iframe文件。 我所做的工作非常适合SimpleModel调用iframe: <a href="http://ibm.com" data-width="586" data-height="570" class="ibm_modal">IBM</a> <script> $('.ibm_modal').click(function(e) { va

我之前有一篇关于SimpleModel和iframe的帖子

但是现在我想调用div而不是iframe文件。

我所做的工作非常适合SimpleModel调用iframe:

 <a href="http://ibm.com" data-width="586" data-height="570" class="ibm_modal">IBM</a>

<script>
    $('.ibm_modal').click(function(e) {
        var hrefval= $(this).attr("href"); 
        var $this = $(this); var height_len = $this.data("height"); 
        var width_len = $this.data("width"); 
        $.modal(
            '<iframe src="' + hrefval + '" height="' +height_len + '" width="' +width_len + '" style="border:none; overflow:auto; margin:0 9px; padding:0; padding-top:10px">', {
           closeHTML:"", 
           overlayCss: {
               backgroundColor:"#000", 
               opacity:85
           },
           containerCss: {
               backgroundColor:"#B9B54F", 
               borderColor:"#B9B54F", 
               border:0, 
               padding:15, 
               height:'height_len+15', 
               width:'width_len+15'
           }, 
           overlayClose: true
        }); 
        e.preventDefault();
    });
</script>

$('.ibm_modal')。单击(函数(e){
var hrefval=$(this.attr(“href”);
var$this=$(this);var height_len=$this.data(“height”);
var width_len=$this.data(“宽度”);
美元模态(
'', {
关闭HTML:“”,
覆盖层:{
背景色:“000”,
不透明度:85
},
集装箱船:{
背景色:“B9B54F”,
边框颜色:“B9B54F”,
边界:0,
填充:15,
高度:'height_len+15',
宽度:'width_len+15'
}, 
套圈:对
}); 
e、 预防默认值();
});
相反,我希望SimpleModel调用一个div。从概念上讲,我不喜欢这样

我想我知道下面这一行必须废弃,并可能替换为div引用,对吗?: ''

这样行吗?我认为它没有指定目标div。所以它是dw

<a data-width="586" data-height="570" class="ibm_modal">IBM</a>

<div style="display:hidden">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
IBM
知识产权是一种权利,是一种精英的权利,是劳动和财富的暂时性权利。但是,在最低限度上,我们需要一个实验室来进行日常工作。两人或两人在一个无教区的房间里互相指责。除偶尔因疏忽而死亡外,不得因疏忽而导致动物死亡

我想要一个链接,当点击打开上面的示例div。我该怎么做?我不理解Eric网页中的基本示例。我喜欢我的语法,我只想将其更改为调用div而不是iframe和文件。
一个
id
类,然后将其用于jquery选择器

例如:

<div id='myContainer'><p>Lorem ipsum dolor</p></div>


$(".modal").click(function(e) {

    $('#myContainer").modal({

      width: $this.data("width"),
      height: $this.data("height"),
      animate: true,
      opacity: 60
    })
    e.stopPropagation();
    return false;
  })
Lorem ipsum dolor

$(“.modal”)。单击(函数(e){ $(“#myContainer”).modal({ 宽度:$this.data(“宽度”), 高度:$this.data(“高度”), 动画:对, 不透明度:60 }) e、 停止传播(); 返回false; })
不起作用…我在尝试了此操作,它显示了应该隐藏的目标div。此外,这不应该是一个类而不是一个ID,因为此模式将在一个页面内多次调用吗?高度和宽度通过:data width=“586”data height=“570传递“。我很难组织这些概念。@verlanger为什么不继续使用相同的模式(更改内容和隐藏/显示)?因为iframe需要html源,但我direct模式可以使用div。