diaoaa / artdialog

Automatically exported from code.google.com/p/artdialog
0 stars 0 forks source link

用jquery绑定弹出层里面的元素事件不起作用 #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

$(document).ready(function(){
$.ajax({
            type: "GET",
            url: "mydiv.html",
            cache: false,
            success: function(data){
                var dialog =art.dialog({
                    lock : true
                });
                dialog.content(data);

            }
        });
}); 

$('#div_img').bind('click',function(){
                                alert(1);
});

--------------------mydiv.html---------------------------
<div style="margin: 20px;border: 1px solid #ddd;padding: 10px 0px 10px 10px;" 
id="div_img">

        <div style="width: 100px;height: 30px;border:1px solid #ddd;
                margin: 0px 10px 10px 0px;
                float: left;" >
            <img width="98px;" js="img_a" height="28px;" src="img/icon-qq.gif"/>
        </div>

        <div style="width: 100px;height: 30px;border:1px solid #ddd;
                margin: 0px 10px 10px 0px;
                float: left;" >
            <img width="98px;" js="img_a" height="28px;" src="img/icon-qq.gif"/>
        </div>

        <div style="width: 100px;height: 30px;border:1px solid #ddd;
                margin: 0px 10px 10px 0px;
                float: left;" >
            <img width="98px;" js="img_a" height="28px;" src="img/icon-qq.gif"/>
        </div>

        <div style="width: 100px;height: 30px;border:1px solid #ddd;
                margin: 0px 10px 10px 0px;
                float: left;" >
            <img width="98px;" js="img_a" height="28px;" src="img/icon-qq.gif"/>
        </div>

        <div style="width: 100px;height: 30px;border:1px solid #ddd;
                margin: 0px 10px 10px 0px;
                float: left;" >
            <img width="98px;" js="img_a" height="28px;" src="img/icon-qq.gif"/>
        </div>

    <div style="clear: both;"></div>
</div>

Original issue reported on code.google.com by liubingw...@gmail.com on 14 Mar 2012 at 5:09