<!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();
})
})