一旦加载了lightbox,我就想加载一个javascript代码。请解释应该使用的事件。
<script>
$j(function() {
alert("hello");
});
</script>
<a href="#generated-code" data-toggle="lightbox">SHOW CODE</a>
<div id="generated-code" class="lightbox hide fade" aria-hidden="true" role="dialog" tabindex="-1" class="container-fluid">
<div class="lightbox-content">
<textarea name="box-content" id="box-content" rows="6" cols="50">Sample text</textarea>
<p><input type="button" id="copy" name="copy" value="Copy" /></p>
</div>
</div> 上面的脚本在页面加载时执行,而不是在我单击lightbox.I中的复制按钮时执行。我想在单击复制按钮时执行脚本,但即使我在jquery中使用单击事件,它也不起作用。
请帮帮忙。
发布于 2013-05-09 17:50:35
如果可能的话,把你加载灯箱的代码贴在这里,不管怎么说,不用看你的代码我能说的是最简单的,就在加载灯箱的代码行后面给出你的javascript代码。
发布于 2013-05-09 18:46:38
要在单击复制按钮时执行脚本,可以使用以下代码
$j(function() {
$j("#copy").click(function(){
// place your code here
});
});https://stackoverflow.com/questions/16458814
复制相似问题