Newbie flickering issue
Newbie flickering issue
Hi all,
I'm new to jQuery and I've put together a sample page to test out some jQuery effects.
It's flickering in both IE and FF, and none of the solutions I've researched have helped (i.e. overflow:hidden). Can anyone spot the issue? I'm very interested in learning what the problem is...
Note that I'm using stop() to remove animate queue build-up, and reset() is a custom function to reset the div size/opacity. Could it be from this? Or the Doctype? or..?
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <style type="text/css">
- .menuButton {
- position:relative;
- float:left;
- background-color:white;
- left:50px;
- top:50px;
- width: 100px;
- height: 20px;
- margin-right:10px;
- border-left:2px solid darkgrey;
- border-right:2px solid darkgrey;
- }
- .menuButton:hover {
- border-left:2px solid red;
- border-right:2px solid red;}
- .pane {
- position:absolute;
- background-color:white;
- left:50px;
- top:100px;
- width: 400px;
- height: 600px;
- margin-left:10px;
- opacity:1;
- border:4px solid darkgrey;
- overflow:hidden;
- }
- </style>
- <script src="http://code.jquery.com/jquery-latest.min.js"></script>
- </head>
- <body>
- <div id="home" class="menuButton" align=center> Home </div>
- <div id="pics" class="menuButton" align=center> Pics </div>
- <div id="picsPane" class="pane">insert info for picsPane div </div>
- <div id="homePane" class="pane"> insert info for homePane div </div>
- <script>
- $.fn.reset = function() {
- $("#homePane").stop();
- $("#picsPane").stop();
- $("#picsPane").animate({opacity:0,height:100,width:100 },0)
- $("#homePane").animate({opacity:0,height:100,width:100 },0)
- }
- $("#home").click(function(){
- $().reset();
- $("#homePane").stop().animate({opacity:1,height:'600px'},'fast')
- .animate({width:'500px'},'slow');
- });
- $("#pics").click(function(){
- $().reset();
- $("#picsPane").stop().animate({opacity:1,height:'600px' },'fast')
- .animate({width:'500px'},'slow');
- });
- </script>
- </body>
- </html>