Bartman Posted December 8, 2011 Share Posted December 8, 2011 Can someone tell me how to make a close button for this? The close button I currently have here makes the IMAGE2 disappear but I cannot see IMAGE1 until the time runs out on the setTmeout. I want to be able to click the closeX and close out the whole script leaving IMAGE1 showing. Here is what I have: <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" bgcolor="#000000" height="350"> <tr> <td align="center"> <script type="text/javascript"> window.onload = function () { setTimeout(function () { var div = document.getElementById('hideOverlay'); div.innerHTML = '[b]IMAGE1 GOES HERE[/b]'; }, 6000);} </script> <div id="hideOverlay"> <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" height="350"> <tr> <td align="center" width="650" height="350"><a style="text-decoration: none" href="javascript:void(0)" onclick="var lyr =document.getElementById('hideOverlay'); lyr.innerHTML='';"/><font color="#666666" size="2">Close [x]</font></a>[b]IMAGE2 GOES HERE[/b]</td> </tr> </table></div> </td> </tr> </table> </div> Quote Link to comment https://forums.phpfreaks.com/topic/252784-jacascript-close-link/ Share on other sites More sharing options...
Bartman Posted December 9, 2011 Author Share Posted December 9, 2011 Here is what I have if anyone can help me get it working. When I click on the Close [X] it does nothing. It just waits and after the seconds the IMAGE1 appears and IMAGE2 disappears. <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" bgcolor="#000000" height="350"> <tr> <td align="center"> <script type="text/javascript"> window.onload = function () { var tim = setTimeout(function () { var div = document.getElementById('hideOverlay'); div.innerHTML = 'IMAGE1 GOES HERE'; }, 6000);} </script> <div id="hideOverlay"> <table border="0" width="650" id="table1" cellspacing="0" cellpadding="0" height="350"> <tr> <td align="center" width="650" height="350"><a style="text-decoration: none" href="javascript:void(0)" onclick="javascript:window.clearTimeout('tim')"/>Close [x]</a><br>IMAGE2 GOES HERE</td> </tr> </table> </td> </tr> </table> </div> Any ideas why it will not work? Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/252784-jacascript-close-link/#findComment-1296421 Share on other sites More sharing options...
Bartman Posted December 10, 2011 Author Share Posted December 10, 2011 Bump....Does anyone know of any other forums that have more javascript coders that might know how to get this working? Quote Link to comment https://forums.phpfreaks.com/topic/252784-jacascript-close-link/#findComment-1296520 Share on other sites More sharing options...
Bartman Posted December 11, 2011 Author Share Posted December 11, 2011 Anyone? :'( Quote Link to comment https://forums.phpfreaks.com/topic/252784-jacascript-close-link/#findComment-1296707 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.