我们需要你们的帮助。 我正在检查其中的内容。 首先,如果发言有效,则不是...... 我甚至尝试过这样的事情,但却没有工作:
else if(($( .current ).prev().hasClass( green )){
alert( Green is Before the current Picture );
}
I want to accomplish this: if green is before class "current" alert "Green is Before the current Picture s". Can someone help me out? Thank you!
http://jsfiddle.net/zresC/“rel=“nofollow”>Fiddle。
我有这一法典:
var $green=$( .green:not(:nth-child(6)) );
$( .greencontroll ).click(function(){
if($green.next($( .current ).length)){
alert( Green is After the current Picture );
}
else if($green.prev($( .current ).length)){
alert( Green is Before the current Picture );
}