Why won't my Javascript functions work?

Fustrousiarax

New Member
I'm trying to edit this JQuery code to work with a PHP, but for some reason, the javascript is not working properly.This is the javascript:function sel(x){ $(this).stop().animate({height:x},{queue:false, duration:600, easing: 'easeOutBounce'})}function desel(){ $(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeOutBounce'})}Here is part of the PHP: foreach($marcas as $mar){ foreach($modelos["$mar"] as $mod){ $tam["$mar"]=$tam["$mar"]+20; } foreach($marcas as $mar){ $aux=$tam["$mar"]; echo "<li style='height: $aux px' onmouseover='sel($aux);' onmouseout='desel();'> <p>$mar</p>"; foreach($modelos["$mar"] as $mod){ echo "<p class='subtext'>$mod</p>"; } echo"<br/></li>"; }Of course, the libraries are both included over the JS code I typed out here, and all the PHP arrays work as intended.Here is the HTML output on a test run.<!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" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Smooth Animated jQuery Menu</title> <link rel="stylesheet" href="http://stackoverflow.com/questions/3578066/animated-menu.css"/> <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script> <script src="http://stackoverflow.com/questions/3578066/js/jquery.easing.1.3.js" type="text/javascript"></script> <script type="text/javascript"> function sel(x){ $(this).stop().animate({height:x},{queue:false, duration:600, easing: 'easeOutBounce'}) } function desel(){ $(this).stop().animate({height:'50px'},{queue:false, duration:600, easing: 'easeOutBounce'}) } </script> </head> <body> <ul> <li style='height: 80 px' onmouseover='sel(80);' onmouseout='desel();'> <p>VolksWagen</p> <p class='subtext'>Bora</p> <p class='subtext'>Beetle</p> <p class='subtext'>Jetta</p> <p class='subtext'>New Beetle</p> <br/></li><li style='height: 20 px' onmouseover='sel(20);' onmouseout='desel();'> <p>Jeep</p> <p class='subtext'>Cherokee</p> <br/></li><li style='height: 20 px' onmouseover='sel(20);' onmouseout='desel();'> <p>Dodge</p> <p class='subtext'>Ram 3500</p> <br/></li></ul> </body> </html>
 
Back
Top