rubahfgouveia Posted January 16, 2011 Share Posted January 16, 2011 Hey all, I've been using Eric Martin's simple modalbox: (http://www.ericmmartin.com/projects/simplemodal/ . It works fine, but currently the modalbox is being triggered with two methods (button or href click): <input type='button' name='osx' value='Demo' class='osx demo'/> <a href='#' class='osx'>Demo</a> I needed the modalbox to be triggered without a user click (onpageload). Is there a way of "faking" a user click on a button or href? Thanks, Ruben Quote Link to comment https://forums.phpfreaks.com/topic/224567-buttonhref-trigger-on-page-load/ Share on other sites More sharing options...
requinix Posted January 16, 2011 Share Posted January 16, 2011 Instead of setting up some Rube Goldberg contraption, add some JavaScript to trigger the box when the page loads. Guessing: There's already some onload code that adds an onclick to anything with class=osx. Find what the onclick function is and call it manually as a second onload handler. Quote Link to comment https://forums.phpfreaks.com/topic/224567-buttonhref-trigger-on-page-load/#findComment-1160041 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.