jQuery动画当前列表项 [英] jQuery animate current list items
问题描述
代码如下: http://jsfiddle.net/hQnXm/7/ >
因此,基本上我需要在悬停时将其设置为仅动画该li项目图像.目前,它会为所有li图像全局设置动画.
代码当前的工作方式,每组<li>
标记都必须位于其自己的<ul class="box">
中,代码才能这样工作: http://jsfiddle.net/YT2LG/
或者,您可以更改以下代码行:
var top = self.closest(".box");
对此:
var top = self.closest(".item");
要获得与HTML一起使用的代码,如下所示: http://jsfiddle.net/jfriend00/DjtKS/
here is the code: http://jsfiddle.net/hQnXm/7/
So basically i need when hover, it should animate only that li item images. Currently it animates all li images globally.
The way the code currently works, each set of <li>
tags needs to be in it's own <ul class="box">
for the code to work like this: http://jsfiddle.net/YT2LG/
Or, you can change this line of code:
var top = self.closest(".box");
to this:
var top = self.closest(".item");
to get the code to work with the HTML you have as shown here: http://jsfiddle.net/jfriend00/DjtKS/
这篇关于jQuery动画当前列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!