正如我所说:jquery不起作用。这个选择,我做错了什么?但它与其他参数一起工作。这里的山小画廊的代码是应该放大所选图像和下移非选择(单元素的作品THO)Jquery不支持.this
$(document).ready(function() {
$("#content img").click(function() {
$("#blackb").slideDown("slow");
$("img", this).animate({
right: "20%"
});
$("img", this).animate({
top: "20%"
});
$("img", this).animate({
width: 802,
height: 584
}, "slow");
$("#content img").not(this).animate({
top: "80%"
}, "slow");
});
});
HTML部分:
<div id="content">
<img id="second" src="model.jpg" alt="model" />
<img id="third" src="model.jpg" alt="model" />
<img id="fourth" src="model.jpg" alt="model" />
<img id="first" src="model.jpg" alt="model" />
</div>
<div id="blackb"></div>
CSS部分:
#content img {
position: absolute;
top: 50%;
right: 50%;
display: none;
width: 160px;
height: 116px;
border: 2px solid white;
z-index: 10;
}
#blackb{
display: none;
position: absolute;
top: 0;
width: 1280px;
height: 888px;
background: black;
opacity: 0.7;
z-index: 9;
}
你还可以发布与选择器相关的HTML和CSS ... #content img,#black,#img? – Hristo 2010-08-10 16:51:32
刚刚redited和他们在那里,即时通讯不使用通用img设置(#img)。 黑b只是画廊的背景 – Pawel 2010-08-10 16:59:27