Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>wang chung</title>
- <script type="text/javascript" src="jquery-1.5.min.js"></script>
- <script type="text/javascript">
- var _show = true;
- $(document).ready(function(){
- $('button#showHide')
- .bind('click', function()
- {
- if (_show)
- {
- $('div#hideMe')
- .animate({
- 'height' : '25px'
- }, 750
- );
- _show = false;
- }
- else
- {
- $('div#hideMe')
- .animate({
- 'height' : '0px'
- }, 750
- );
- _show = true;
- }
- });
- });
- </script>
- <style type="text/css">
- body{
- background-color:#003366;
- padding :0px;
- margin :0px;
- text-align :center;
- }
- button{
- cursor : pointer;
- right : 5px;
- float : right;
- position : relative;
- top : 5px;
- }
- div#hideMe{
- background-color:#FF3399;
- height : 0px;
- overflow : hidden;
- position : relative;
- }
- div#container{
- background-color:#FFFFFF;
- border : #FFFF00 1px solid;
- height : 600px;
- margin-left : auto;
- margin-right: auto;
- overflow : hidden;
- position : relative;
- width : 960px;
- }
- div#contents{
- height : 600px;
- position : absolute;
- width : 100%;
- }
- </style>
- </head>
- <body>
- <div id="hideMe" >Congratulations, you just won a punch in the neck!</div>
- <div id="container">
- <div id="contents">
- <button id="showHide">clicker</button>
- </div>
- </div>
- </body>
- </html>
- var OP=90;
- function processFade()
- {
- var t="";
- OP = OP - 3;
- if(OP < 0)
- {
- clearTimeout(t);
- OP=90;
- return;
- }
- $("YOUR_DIV_ELEMENT_HERE").style.filter = "alpha(opacity="+OP+")";
- if(OP ==0)
- {
- $("YOUR_DIV_ELEMENT_HERE").style.display = "none";
- clearTimeout(t);
- OP=90;
- return;
- }
- t=setTimeout("processFade();",100);
- }
- function initFade()
- {
- processFade();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement