943,752 Members | Top Members by Rank

Ad:
Jul 15th, 2009
0

popup with background disabled

Expand Post »
I need a script to generate a popup when page loads with background disabled. Please help
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
dips255 is offline Offline
36 posts
since Jun 2008
Jul 15th, 2009
0

Re: popup with background disabled

Click to Expand / Collapse  Quote originally posted by dips255 ...
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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
zhoush24 is offline Offline
1 posts
since Jul 2009
Jul 15th, 2009
0

Re: popup with background disabled

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>
Featured Poster
Reputation Points: 114
Solved Threads: 138
Posting Shark
essential is offline Offline
973 posts
since Aug 2008
Jan 3rd, 2011
0

Hear :PupUp & Disable Background.

this is your code babe:

<HTML>
<HEAD>
<TITLE>PopUp Div + Background Disable</TITLE>
<style>
body
{
background-image:url("1.gif");
}
.parentDisable
{
z-index:999;
width:100%;
height:100%;
display:none;
position:absolute;
top:0;
left:0;
background-color: #000;
color: #aaa;
opacity: .4;
filter: alpha(opacity=50);
}
#popup
{
width:300;
height:300;
position:relative;
color: #000;
background-color: #fff;
top:25%;
background-image:url(catbg-1.gif);

}
#close
{
position:absolute;
top:0;
right:0;
}
</style>
<script type="text/javascript">
function pop(div)
{
document.getElementById(div).style.display='block';
return false
}
function hide(div)
{
document.getElementById(div).style.display='none';
return false
}
</script>
</HEAD>
<BODY>
<div id="pop1" class="parentDisable">
<center>
<div id="popup">
This is popup 1
<a href="#" onClick="return hide('pop1')">
<div id="close">
<img src="close.png" width="40px" height="40px"/>
</div>
</a>
</div>
</div>



<center>
<h3>Simple Popup Div + Background Disable Example</h3>
</br></br>
<a href="#" onClick="return pop('pop1')">Popup 1</a>
</center>


</BODY>
</HTML>



if u need any thing i am ready for any thing.....
Good luck..


Eng.M.Dael
Professional Designer & Web Developer
sakherdael@hotmail.com
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sakherdael is offline Offline
1 posts
since Jan 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Money counter
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Make a Tree Menu





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC