Jump to content

Button/Href trigger on page load?


rubahfgouveia

Recommended Posts

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

 

 

Link to comment
https://forums.phpfreaks.com/topic/224567-buttonhref-trigger-on-page-load/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.