本帖最后由 qq_15025215 于 2014-06-07 10:51:14 编辑

解决方案 »

  1.   

    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <style>
    ul{margin:0;padding:0;}
    li{list-style:none;}
    </style>
    <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
    <script>
    $(function(){
    $('li').not(':has(img)').hide();//隐藏不包含img的li
    })
    </script>
    </head>
    <body>
    <ul>
    <li><a ><img /></a>1</li>
        <li>3</li>
        <li><img />2</li>
    </ul>
    </body>
    </html>