CSS Popup Background Translucent window

Source: Internet
Author: User

  1. <script type="Text/javascript" src="<ww:url value= '/js/jquery-1.8.3.min.js '/>" Language="javascript"></script>
  2. <script type="Text/javascript">
  3. $ (function () {
  4. var query = location.search;
  5. var equal_index = query.lastindexof ("=");
  6. var result_index = query.indexof ("result");
  7. var submit_index = query.indexof ("submit");
  8. if (result_index! =-1) {
  9. if (query.substring (Equal_index + 1) = = ' success ') {
  10. $ ("#msg"). Text (' Save succeeded ');
  11. Pupopen ();
  12. }
  13. }
  14. if (submit_index! =-1) {
  15. if (query.substring (Equal_index + 1) = = ' success ') {
  16. $ ("#msg"). Text (' escalation successful ');
  17. Pupopen ();
  18. }
  19. }
  20. });
  21. function Pupopen () {
  22. $ ("#bg"). CSS ("Display", "block");
  23. $ ("#popbox"). CSS ("Display", "block");
  24. $ (window). Scroll (function () {$ (window). scrolltop (0);}); /Disable Browser scroll screen
  25. }
  26. function Pupclose () {
  27. $ ("#bg"). CSS ("display", "none");
  28. $ ("#popbox"). CSS ("display", "none");
  29. $ (window). Unbind ("scroll");//Restore Browser scroll screen
  30. }
  31. </Script>
  32. <style type="Text/css">
  33. body{margin:0px;}
  34. #bg {width:100%;height:100%;top:0px;left:0px;position:absolute;filter:alpha (opacity=); opacity:0.5; Background: #000000;  Display:none;}
  35. #popbox {position:absolute;width:300px; height:200px; left:50%; top:50%; margin:-200px 0 0-200px; display:none; Background: #FFFFFF;}
  36. </style>
  37. <body>
  38. Finally fix this effect, ie and ff,op can all ~
  39. First say the principle: two layers, a height and width are 100%, the other is you want to pop up the specific content of the window, semi-transparent in IE with Filter:alpha (opacity=60), in non-IE with opacity:0.60;
  40. </br>
  41. <div id= "BG" ></div>  
  42. <div id= "PopBox" >< Center style= "margin-top:70px;" ><img src= "<ww:url value= '/image/correct.jpg '/>"  /> < span class= "tag" ><span id= "MSG" ></span> </center>  
  43. <br/><br/><br/>
  44. <img src="<ww:url value= '/image/ok.png '/>" width= "+" height= " onclick="Pupclose ()" style="Cursor:pointer"/>
  45. </div>
  46. </body>

CSS Popup Background Translucent window

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.