javascript - Pop-up content sometimes appearing behind main content -


on wordpress website have button set on top right of screen (request demo) when click it, popup appears text , hubspot form. have working fine whatever reason 1 out of 10 page reloads content of hubspot form won't appear in popup appear behind main content on web page default without button being clicked.

it's particularly bad on firefox though seems happen 50% of time. i'm struggling find solution this.

website url: http://crowdsight.co/

thanks, jonathan

haven't succeeded in reproducing problem yet sounds js hiding form , attaching click event "request demo" failed job. because can't find elements in dom(the form , "request demo"). make sure form , button's initialization happens after dom ready:

jquery(document).ready(function() {     //initialization here }); 

or:

document.addeventlistener("domcontentloaded", function(event) {     //initialization here });//unlike jquery function, works modern browsers. 

if above fails, can try(though doesn't make sense if above fails):

window.onload = function() {     //initialization here     //here wait resources retrieved before go, while     //the above approaches waits dom } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -