Hello, I have been dealing with an odd problem that .click()
events happen twice whenever placed in a jQuery Dialog.
My simple test case is below and a live example is here
<div id="popup" style="display: none">
<a href="javascript:void(0);" id="testlink">Test Link</a>
<script type="text/javascript">
$('#testlink').click(function(){
alert("Test Link clicked");
return 0;
});
</script>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#popup').css('display','block');
var h=($(window).height()+0.0)*0.9;
var w=($(window).width()+0.0)*0.9;
if(w >= 800){
w = 800;
}
$('#popup').dialog({
autoOpen: true,
width: w,
height: h,
modal: true,
open: function(event,ui){
$('body').css('overflow', 'hidden');
},
close: function(event,ui){
$('body').css('overflow', 'scroll');
}
});
});
</script>