<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>挑战题</title> <style> li{list-style:none} </style> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script> <script> $(function(){ var $visible=$("li:hidden"); $("a").click(function(){ if($(this).html()=="更多"){ $(this).html("简化"); $("li:hidden").css("display","block"); } else{ $(this).html("更多"); $visible.css("display","none"); } }); }); </script> </head> <body> <ul> <li>1</li> <li>2</li> <li style="display:none">3-none</li> <li style="display:none">4-none</li> <li style="display:none">5-none</li> <li>6</li> <li>7</li> <li>8</li> </ul> <a href="javascript:;">更多</a> </body> </html>
cherry_0011
2014-08-30
1 回答
举报
0/150
提交
取消