popup with background disabled

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Jun 2008
Posts: 25
Reputation: dips255 is an unknown quantity at this point 
Solved Threads: 0
dips255 dips255 is offline Offline
Light Poster

popup with background disabled

 
0
  #1
Jul 15th, 2009
I need a script to generate a popup when page loads with background disabled. Please help
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 1
Reputation: zhoush24 is an unknown quantity at this point 
Solved Threads: 0
zhoush24 zhoush24 is offline Offline
Newbie Poster

Re: popup with background disabled

 
0
  #2
Jul 15th, 2009
Originally Posted by dips255 View Post
I need a script to generate a popup when page loads with background disabled. Please help
dfasdasdasd
asd
a
d
asd
asdasdasd
a
sd
asd
as
dasd
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

Re: popup with background disabled

 
0
  #3
Jul 15th, 2009
Try this simple demo of a custom popup:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html id="html40L" lang="en">
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  7. <meta http-equiv="Content-Style-Type" content="text/css">
  8. <meta http-equiv="Content-Script-Type" content="text/javascript">
  9. <meta http-equiv="Window-target" content="_top">
  10. <title>Free Live Help!</title>
  11. <style type="text/css">
  12. <!--
  13. label + div {
  14. margin-bottom : 1em; font : 700 16pt "Trebuchet MS", "Bernard MT Condensed", Verdana, Arial, sans-serif; }
  15. -->
  16. </style>
  17. <script type="text/javascript">
  18. <!--
  19. var customPopup = function( w, h, elem ) {
  20. elem = (( document.getElementById ) ? document.getElementById( elem ) : document.all[ elem ] );
  21. var checked = true;
  22. var posTop;
  23. var posLeft;
  24. try {
  25. if ( document.body.scrollWidth ) {
  26. posLeft = document.body.scrollWidth;
  27. posTop = (( window.screen.availHeight ) ? screen.availHeight : document.body.scrollHeight );
  28. }
  29. } catch( error ) {
  30. if ( window.scrollMaxY ) {
  31. posLeft = window.scrollMaxX;
  32. posTop = window.scrollMaxY;
  33. } else {
  34. check = false;
  35. }
  36. } if ( checked ) { // You can implement more style rules from here.
  37.  
  38. var divWidth = (( posLeft * w ) / 100 );
  39. var divHeight = (( posTop * h ) / 100 );
  40. elem.style.width = divWidth;
  41. elem.style.height = divHeight;
  42. elem.style.backgroundColor = "#eee";
  43. elem.style.border = "2px solid #405060";
  44. elem.style.position = "absolute";
  45. elem.style.left = Math.ceil((( posLeft - divWidth ) / 2 )) + "px";
  46. elem.style.top = Math.ceil((( posTop - divHeight ) / 2 )) + "px";
  47. }
  48. };
  49. window.onload = function() {
  50. customPopup( 40, 40, "main" );
  51. }
  52. // -->
  53. </script>
  54. </head>
  55. <body>
  56. <div id="main"><div style="padding : 1em; color : #405060; text-align : center"><h1 style="margin : 0 auto; padding : 0;">Custom Popup</h1></div></div>
  57.  
  58. </body>
  59. </html>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC