_This
2015-10-26 19:56
<!doctype html> <html> <head> <title>任意属性值</title> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css" href="CSS/style.css"> <!--<script type="text/javascript" src="JS\Move.js"></script>--> <script type="text/javascript" src="JS\json.js"></script> <script> window.onload=function(){ var oli=document.getElementById('li1') oli.onmouseover=function(){ startMove(oli,{width:400},function(){ startMove(oli,{height:200},function(){ startMove(oli,{opacity:100}) }) }) } oli.onmouseout=function(){ startMove(oli,{opacity:30},function(){ startMove(oli,{height:100},function(){ startMove(oli,{width:200}) }) }) } var olio=document.getElementById('li2'); olio.onmouseover=function(){ startMove(olio,{width:400,height:200,opacity:100}); } olio.onmouseout=function(){ startMove(olio,{width:200,height:100,opacity:30}); } } </script> </head> <body> <ul> <li id="li1"></li> <li id="li2"></li> </ul> </body> </html>
在js文件中加上楼下代码就OK了,问题已解决
if (icon==json[attr]) { flag=true; }else{ flag=false; }
JS动画效果
113925 学习 · 1443 问题
相似问题