iceman023 Posted April 14, 2009 Share Posted April 14, 2009 I found this code online... Does anything think this is the eastest way to do this.. I just want the background to be inactive/greyed out while a popup is active to add text.. <script language="javascript" type="text/javascript"> function showPopUp() { document.getElementById("dialogue").style.display = ""; document.getElementById("overlay").style.display = ""; } function hidePopUp() { document.getElementById("dialogue").style.display = "none"; document.getElementById("overlay").style.display = "none"; } </script> <style type="text/css"> *html #overlay { /*\*/ position:absolute; top: expression(((ignoreMe = document.documentElement.scrollTop? document.documentElement.scrollTop : document.body.scrollTop)) + 'px'); left: expression(((ignoreMe2 = document.documentElement.scrollLeft? document.documentElement.scrollLeft : document.body.scrollLeft)) + 'px'); /**/ } </style> <div id="dialogue" style="position:absolute;z-index:2000;top:280px;left:240px;width:340px;height:130px;border:1px solid black;background-color:#0055E7;font-size:12px;font-weight:bold;color:white;display:none"> Pop Up Window <table style="margin:13px 5px 5px 5px;background-color:lightyellow;color:black"> <tr><td align="center" colspan="2">What would you like to do now?<br /><br /></td> </tr> <tr> <td><input type="button" name="btn_Close" id="btn_Close" onClick="hidePopUp()" value="Hide PopUp" /></td> <td><input type="button" name="btn_Nothing" id="btn_Nothing" onClick="return false" value="Nothing" /></td> </tr> </table> </div> <div id="overlay" style="position:fixed;z-index:1000;top:0px;left:0px;width:100%;height:100%;background-color:#666666;opacity:.7;filter:alpha(opacity=70);display:none"> </div> Quote Link to comment Share on other sites More sharing options...
rascle Posted April 19, 2009 Share Posted April 19, 2009 All other codes i know that do what you want it to, are just as complicated / as long as the one you provided! Quote Link to comment 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.