我在div上有5个图像(如产品的拇指图像)。而且我还有另外一个div,并附有简短的标签部分。通过点击另一个div中的图像显示div(具有样式“display:none”)
我的编码(如下面):
- 分度,5个图像。
- 另一个分部有5个选项卡部分及其产品详细信息。
- 另外,第二个div有财产
style"display:none"
。我想让它看到它的详细的div部分点击拇指。
在此先感谢。
我在div上有5个图像(如产品的拇指图像)。而且我还有另外一个div,并附有简短的标签部分。通过点击另一个div中的图像显示div(具有样式“display:none”)
我的编码(如下面):
style"display:none"
。我想让它看到它的详细的div部分点击拇指。在此先感谢。
我的回答只能和你的描述一样。
$("#theDivToBeClickedOn").click(function(){
$("#theDivWhereImageIs").show();
});
我假设你有一个有具体形象的描述,所以你必须显示/隐藏他们太多其他一些标签。
$('#div1 img').click(function(){ //when you click on the thumb in the first div
var i = $('#div1 img').index(this); //get index of thumb to correspond to image
$('#div3').toggle(); //show third div
$('#div3 div').eq(i).toggle(); //show the particular thumb's description
});
一些HTML会很好。 – 2010-12-06 17:59:09