Orionsbelter Posted January 18, 2009 Share Posted January 18, 2009 ok, i have a bit of coding that'll open a light box when onclick="document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'" is click how ever i want document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block' to open when the page is loaded how can i do it? Link to comment https://forums.phpfreaks.com/topic/141319-help-with-onclick/ Share on other sites More sharing options...
Daniel0 Posted January 18, 2009 Share Posted January 18, 2009 Add this: <script type="text/javascript"> window.onload = function() { document.getElementById('light').style.display='block'; document.getElementById('fade').style.display='block'; }; </script> Link to comment https://forums.phpfreaks.com/topic/141319-help-with-onclick/#findComment-739668 Share on other sites More sharing options...
Orionsbelter Posted January 18, 2009 Author Share Posted January 18, 2009 Thanks will try it now Link to comment https://forums.phpfreaks.com/topic/141319-help-with-onclick/#findComment-739670 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.