943,725 Members | Top Members by Rank

Ad:
Feb 19th, 2009
0

Request: Javascript for getting always on top popup window.

Expand Post »
hi,
I want to build a popup window that should not be minimized and maxmized. that should be always on top. when other window is opened then the pop up window should not be minimized.

Please help meeeeee

thanks in advance
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Narayan15 is offline Offline
20 posts
since Nov 2008
Feb 19th, 2009
0

Re: Request: Javascript for getting always on top popup window.

I believe you're talking about a "popup" that is more of a modal window then a true popup. This would mean creating a div that is positioned above the page and floats over everything else.

Here's a quick example of how you could do this with jQuery and CSS.
The fixed positioning is solved thanks to an example by stu nicholls at CSS Play. This should leave the div fixed so that it doesnt scroll with the page even on IE 6. IT fades in when the page loads and it fades out when its clicked.

Please don't hesitate to ask any questions if it doesn't make sense.

html Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6.  
  7. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"></script>
  8. <script type="text/javascript">
  9. $(document).ready(function() {
  10. //Make the notice DIV display on page load
  11. $('#notice').fadeIn(1500);
  12. //Register a click event on the DIV[id=notice] and make it fade out.
  13. $('#notice').click( function() {
  14. $(this).fadeOut(1500);
  15. });
  16. });
  17. </script>
  18. <style>
  19.  
  20. #notice {display:block; top:200px; left:200px; height:110px; width:276px; position:fixed; border:2px solid black; padding:10px; z-index:1000; background-color:white; display:none;}
  21. * html #notice {position:absolute;}
  22.  
  23. </style>
  24. <!--[if lte IE 6]>
  25. <style type="text/css">
  26. /*<![CDATA[*/
  27. html {overflow-x:auto; overflow-y:hidden;}
  28. /*]]>*/
  29. </style>
  30. <![endif]-->
  31. </head>
  32. <body>
  33. <div id="notice">
  34. <img src="http://www.google.com/intl/en_ALL/images/logo.gif" />
  35. </div>
  36.  
  37. <!-- write out 10 paragraphs to keep code short -->
  38. <!-- there is no other reason to do it this way -->
  39. <script type="text/javascript">
  40. for( i=0; i<10; i++)
  41. {
  42. document.write('<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed gravida lorem ac mi. Morbi non risus vel mi convallis iaculis. Integer ac elit id mi venenatis fringilla. Aliquam aliquet varius nisi. Proin pellentesque risus ac turpis. Nam vestibulum semper mauris. Nullam fermentum, felis sed sagittis volutpat, purus nisl aliquet enim, sit amet blandit mauris lectus eget nisl. Nullam purus erat, consectetur vitae, auctor eget, euismod sed, elit. Vivamus nec tortor a mauris suscipit viverra. Nam malesuada. Ut porta mattis felis. Aenean sed felis. Suspendisse viverra varius arcu. Nunc felis. Donec eget sem in eros rutrum commodo. Vivamus sagittis. Aliquam erat volutpat. </p> ');
  43. }
  44. </script>
  45.  
  46. </body>
  47. </html>
Sponsor
Reputation Points: 265
Solved Threads: 126
Practically a Master Poster
mschroeder is offline Offline
624 posts
since Jul 2008

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: Shadowbox not working with dreamweaver Rollover?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: xml to html table v.2





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


Follow us on Twitter


© 2011 DaniWeb® LLC