elmu
02-14-2011, 02:40 PM
Hello,
I have a site design where I want to make an animation on a box to make it wider in case of mouseover and back to it's original size in case of mouseout.
I use jQuery to make the animation. It works fine in every browser except IE8s.
In IE8 after the animation there are some garbage vertical lines on the area where the box was opened.
I tried to make my code as small as possible to demonstarte the problem:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
* {
padding:0;
margin:0;
}
html, body {
height:100%;
width:100%;
}
body {
background-color: #ccc;
}
#mainBg {
height:200px;
margin-top:50px;
background-color:#000;
}
#wrapper {
width:1000px;
margin: 0px auto;
margin-top:-250px;
}
#content {
width:600px;
background-color: #f4f4f4;
float:left;
min-height:700px;
}
.box {
width:400px;
}
.boxContent {
padding:40px;
background-color: #fff;
overflow:hidden;
}
</style>
</head>
<body>
<div id="mainBg"></div>
<div id="wrapper">
<div id="content">
<div class="box">
<div class="boxContent" onmouseover="openBox(this);" onmouseout="closeBox(this);">
box
</div>
</div>
</div>
</div>
<script type="text/javascript">
function openBox(element){
$(element).animate({width: '800'},500);
}
function closeBox(element){
$(element).animate({width: '400'},500);
}
</script>
</body>
</html>
Any idea how to solve this?
Thanks in advance?
I have a site design where I want to make an animation on a box to make it wider in case of mouseover and back to it's original size in case of mouseout.
I use jQuery to make the animation. It works fine in every browser except IE8s.
In IE8 after the animation there are some garbage vertical lines on the area where the box was opened.
I tried to make my code as small as possible to demonstarte the problem:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<style type="text/css">
* {
padding:0;
margin:0;
}
html, body {
height:100%;
width:100%;
}
body {
background-color: #ccc;
}
#mainBg {
height:200px;
margin-top:50px;
background-color:#000;
}
#wrapper {
width:1000px;
margin: 0px auto;
margin-top:-250px;
}
#content {
width:600px;
background-color: #f4f4f4;
float:left;
min-height:700px;
}
.box {
width:400px;
}
.boxContent {
padding:40px;
background-color: #fff;
overflow:hidden;
}
</style>
</head>
<body>
<div id="mainBg"></div>
<div id="wrapper">
<div id="content">
<div class="box">
<div class="boxContent" onmouseover="openBox(this);" onmouseout="closeBox(this);">
box
</div>
</div>
</div>
</div>
<script type="text/javascript">
function openBox(element){
$(element).animate({width: '800'},500);
}
function closeBox(element){
$(element).animate({width: '400'},500);
}
</script>
</body>
</html>
Any idea how to solve this?
Thanks in advance?