在隐藏/显示 div 方面需要一点帮助。我知道这里有一些帖子,但没有一个专门针对我想要做的事情。
我的代码如下。我想做的是从leftColum LI单击时显示相应的DIV。
<div id="leftColumn">
<ul>
<li> <a href="#">Painting</a> </li>
<li> <a href="#">Landscaping</a> </li>
<li> <a href="#">Kitchen</a> </li>
<li> <a href="#">What's next?</a> </li>
</ul>
</div>
<div id="rightColumnPainting">
<ul>
<li> <a href="painting.html"></a><img src="./img/house1.jpg" width="100" height="100" /> </li>
<li> <a href="painting.html"></a><img src="./img/house1.jpg" width="100" height="100" /> </li>
<li> <a href="painting.html"></a><img src="./img/house1.jpg" width="100" height="100" /> </li>
<li> <a href="painting.html"></a><img src="./img/house1.jpg" width="100" height="100" /> </li>
</ul>
</div>
<div id="rightColumnLandscaping">
<ul>
<li> <a href="painting.html"></a><img src="./img/paint1.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/paint2.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/paint3.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/paint4.jpg" /> </li>
</ul>
</div>
<div id="rightColumnKitchen">
<ul>
<li> <a href="painting.html"></a><img src="./img/yard1.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/yard2.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/yard3.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/yard4.jpg" /> </li>
</ul>
</div>
<div id="rightColumnNext">
<ul>
<li> <a href="painting.html"></a><img src="./img/house1.jpg" width="100" height="100" /> </li>
<li> <a href="painting.html"></a><img src="./img/house2.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/house3.jpg" /> </li>
<li> <a href="painting.html"></a><img src="./img/house4.jpg" /> </li>
</ul>
</div>