javascript - typeerror begin is undefined - firefox -
i have menu
<div id="toptest"></div><div id="cover" style="position:relative;z-index:800;"> <div id="header"> lumen photography </div> <div class="wrapper"> <ul id="navigation"> <li><a href="#" alt="toptest" class="subinfo">home<span>welkom!</span></a></li> <li><a href="#" alt="wie" class="subinfo">wie zijn we<span>info on ons</span></a></li> <li><a href="#" alt="contact" class="subinfo">contact<span>(aan)vraag</span></a></li> <li><a href="#" alt="ref" class="subinfo">referenties<span>enkele namen...</span></a></li> </ul> </div> </div> <div style="position:fixed;width:100%;top:0px;z-index:600;box-shadow:0px 0px 6px black"> <div id="mainmenu"> <ul id="yw0"> <li><a href="#" alt="toptest" class="subinfo">home</a></li> <li><a href="#" alt="wie" class="subinfo">wie zijn we</a></li> <li><a href="#" alt="contact" class="subinfo">contact</a></li> <li><a href="#" alt="ref" class="subinfo">referentie</a></li>
it's 2 menus. they're same 1 behind others , appears if scroll down (i don't want use semi fixed header appears on scroll. lags on slow pc's).
this javascript declarations:
<script src="js/jquery.scrollto-1.4.3.1.js"></script> <script src="js/jqueryui.js"></script> <script src="js/jquery.animate-colors.js"></script> <script src="js/jquery.slides.min.js"></script>
and jquery.js declared entirely @ top.
i have var co; $('.subinfo').hover( function(){ co = $(this).css('color'); $(this).children().stop().animate({opacity:1}, 200);
$(this).children().animate({color:returncolor()},100); $(this).stop().animate({color:returncolor()},100); }, function(){ $(this).children('span').stop().animate({opacity:0}, 200); $(this).stop().animate({backgroundcolor:'rgba(255, 255, 255, 0)', color:co}); } );
as event listener.
in chrome, works. in firefox, works hover, not leave. gives me error: typeerror: begin undefined (r:76 in animate-colors) animate colors jquery plugin. used before , never experienced problem..
what do?
ok, seems firefox needs know initial background-color
of element animating. have add before animation starts:
.subinfo { background-color:white; }
if want animate color, it's important know both end color , initial one. don't know why chrome doesn't fail or color using starting point...
it should work that, if not, post jsfiddle: http://jsfiddle.net/
Comments
Post a Comment