程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> 更多編程語言 >> 編程綜合問答 >> show hide-點擊2隱藏1 點擊1隱藏2 那點擊3 4 5該怎麼弄?

show hide-點擊2隱藏1 點擊1隱藏2 那點擊3 4 5該怎麼弄?

編輯:編程綜合問答
點擊2隱藏1 點擊1隱藏2 那點擊3 4 5該怎麼弄?

圖片說明

 <!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" />
<script src="jquery-1.9.1.min.js" type="text/javascript"> </script>
<link href="style.css" rel="stylesheet" />
<title>無標題文檔</title>

<script type="text/javascript" language="javascript">
     $(function () {
        $(".helpBox-leftbox li").click(function () {
            var Current = $(this).index();
            $('[helpTutorials]').hide();//隱藏所有對象 
            $('.helpTutorials' + Current).fadeIn();
        })
    }) 
</script>
</head>


<body>
<div class="helpBox">
        <div class="helpBox-left">
            <strong>XXX</strong>
            <div class="helpBox-leftbox">   
                <ul>
                    <span>XXX</span>
                    <li>1</li>
                    <li>2</li>
                    <li>3</li>
                </ul>
                <ul>
                    <span>XXX</span>
                    <li>4</li>
                    <li>5</li>
                    <li>6</li>
                    <li>7</li>  
                </ul>
                <ul>
                    <span>XXX</span>
                    <li>8</li>
                    <li>9</li>
                    <li>10</li> 
                </ul>
            </div>
        </div>
        <div class="helpTutorials helpTutorials1">
            <div class="help-one">
                <span>《null - 1》</span> 
            </div>
            <p>
                    1.............<br />


            </p>
        </div>
        <div class="helpTutorials helpTutorials2">
            <div class="help-one">
                <span>《kong - 000000000000000000000000000000000000000002》</span>    
            </div>
            <p>

            </p>
        </div>
        <div class="helpTutorials helpTutorials3">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>

            </p> 
        </div>
        <div class="helpTutorials helpTutorials4">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
        <div class="helpTutorials helpTutorials5">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
        <div class="helpTutorials helpTutorials6">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
        <div class="helpTutorials helpTutorials7">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
        <div class="helpTutorials helpTutorials8">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
        <div class="helpTutorials helpTutorials9">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
        <div class="helpTutorials helpTutorials10">
            <div class="help-one">
                <span>《bai - 200000000000000000》</span> 
            </div>
            <p>
                    1.............<br />
                    2.............<br /> 
                    3.............
            </p> 
        </div>
    </div>
</body>
</html>

最佳回答:


給你的.helpTutorialsX增加自定義屬性helpTutorials,然後獲取這些對象隱藏,在顯示點擊的對應的對象。

     $(function () {
        $(".helpBox-leftbox li").click(function () {
            var Current = $(this).index();
            $('[helpTutorials]').hide();//隱藏所有對象 
            $('.helpTutorials' + Current).fadeIn();
        })
    }) 
showbo
qq_17505839
showbo
qq_17505839
u011376884
u011376884
qq_17505839
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved