Exit dynamic popup by clicking outside of it?

I have a popup where i basically just dim the body giving it the lights out effect. I have a click handeler where if the body is clicked it will close the popup but my issue is the click handler stops all clicks even before the popup is opened. Does anyone know how i could do this so that clicking on a link before the popup is opened would go to the link but clicking one after the popup was opened would do my function and not click the link? Heres what i use right now: $(document).ready(function() { $("body").click(function(){ var element=document.getElementById("game"); //yes i could use the jquery method for all of these but this works element.width="650"; element.height="500"; element.style.position="relative"; $("body").fadeTo(3000,1.0); } return false; }) });

以上就是Exit dynamic popup by clicking outside of it?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准