javascript - Simulate a document.body click event -
i having big of issue. have third party js includes , popup info on button click, in iframe. of course, don't have access iframe. 3rd party captures clicks , closes iframe popup. behaviour -
i user, click on "3rd party button, iframe popups anchored bottom right". now, if click anywhere on main parent page (my page), iframe closes.
here problem. have custom form fields/spans etc.... in capture clicks before bubble document.body never "click".
how can fake out? tried "mousedown" , seems propagate up. said like:
jquery(document.body).mousedown(function(){ jquery(document.body).click(); }) so, no matter mousedown, try there click happening. doesn't work. not sure why? if attach click onto div , alert - alerts, perhaps "natively" isn't same.
any ideas of simulate body click event when/if element clicked on has had native clicked event captures before can bubble up?
edit: have tried various things. ie:
<div id="captureclick"></div> <script> jquery(document.body).mousedown(function(){ jquery("#captureclick").click(); }) </script> i tried: jquery's trigger function trigger('click');
not working. haven't tried using button "click traget", yet. thanks.
Comments
Post a Comment