animate effect throws error in IE8
Hello.
I have a problem with the switchClass function in IE8
.sidebar_hidden{position:absolute;width:350px;left:330px;top:
100px;background-color:#ffffff;border:1px solid black;padding-left:
15px;}
.sidebar_visible{position:absolute;width:350px;left:-10px;top:
100px;background-color:#ffffff;border:1px solid black;padding-left:
15px;}
two classes that i use for a div called sidebar. the only difference
between them is the left value.
function showsidebar()
{
var sidebar=$("#sidebar");
if(sidebar.hasClass("sidebar_visible"))
sidebar.switchClass('sidebar_visible','sidebar_hidden',1000);
else
sidebar.switchClass('sidebar_hidden','sidebar_visible',1000);
}
<div id="sidebar" class="sidebar_hidden ui-corner-all">
this div should move back and fourth.
</div>
when i run this function it works fine in Firefox, but in IE8 it only
works only one way. (regardless if the sidebar div has hidden or
visible class set from the beginning).
Any ideas?
Regards
Mats