Advertisement
Guest User

Untitled

a guest
Aug 1st, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>wang chung</title>
  4. <script type="text/javascript" src="jquery-1.5.min.js"></script>
  5. <script type="text/javascript">
  6.  
  7. var _show = true;
  8. $(document).ready(function(){
  9.  
  10. $('button#showHide')
  11. .bind('click', function()
  12. {
  13. if (_show)
  14. {
  15. $('div#hideMe')
  16. .animate({
  17. 'height' : '25px'
  18. }, 750
  19. );
  20. _show = false;
  21. }
  22. else
  23. {
  24. $('div#hideMe')
  25. .animate({
  26. 'height' : '0px'
  27. }, 750
  28. );
  29. _show = true;
  30. }
  31. });
  32. });
  33.  
  34. </script>
  35. <style type="text/css">
  36.  
  37. body{
  38. background-color:#003366;
  39. padding :0px;
  40. margin :0px;
  41. text-align :center;
  42. }
  43.  
  44. button{
  45. cursor : pointer;
  46. right : 5px;
  47. float : right;
  48. position : relative;
  49. top : 5px;
  50. }
  51.  
  52. div#hideMe{
  53. background-color:#FF3399;
  54. height : 0px;
  55. overflow : hidden;
  56. position : relative;
  57. }
  58.  
  59. div#container{
  60. background-color:#FFFFFF;
  61. border : #FFFF00 1px solid;
  62. height : 600px;
  63. margin-left : auto;
  64. margin-right: auto;
  65. overflow : hidden;
  66. position : relative;
  67. width : 960px;
  68. }
  69.  
  70. div#contents{
  71. height : 600px;
  72. position : absolute;
  73. width : 100%;
  74. }
  75.  
  76. </style>
  77. </head>
  78. <body>
  79. <div id="hideMe" >Congratulations, you just won a punch in the neck!</div>
  80. <div id="container">
  81. <div id="contents">
  82. <button id="showHide">clicker</button>
  83. </div>
  84. </div>
  85. </body>
  86. </html>
  87.  
  88. var OP=90;
  89. function processFade()
  90. {
  91. var t="";
  92. OP = OP - 3;
  93. if(OP < 0)
  94. {
  95.  
  96. clearTimeout(t);
  97. OP=90;
  98. return;
  99. }
  100. $("YOUR_DIV_ELEMENT_HERE").style.filter = "alpha(opacity="+OP+")";
  101. if(OP ==0)
  102. {
  103. $("YOUR_DIV_ELEMENT_HERE").style.display = "none";
  104. clearTimeout(t);
  105. OP=90;
  106. return;
  107. }
  108. t=setTimeout("processFade();",100);
  109. }
  110. function initFade()
  111. {
  112. processFade();
  113. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement