选择有图像的李

时间:2011-01-17 13:23:27

标签: jquery-selectors

我想应用ifixpng函数,对于有图像的li,但我无法选择下面的图像并应用ifixpng函数,我该如何选择

< li style =“list-style-image:url(”http://images.abbottnutrition.com/Glucerna.com.br-HCP/IMAGES/bullet.png“);”> abc< / li>

1 个答案:

答案 0 :(得分:0)

在css中使用样式不是更好吗?

选择它更容易

的CSS:

.image{
 list-style-image: url("http://images.abbottnutrition.com/Glucerna.com.br-HCP/IMAGES/bullet.png")
}

JS:     $('li .image')。some_func()

解决方案:

$('ul li[style*="list-style-image"]').foo() 

并且html应该是正常的':

<li style='list-style-image: url("images.abbottnutrition.com/Glucerna.com.br-HCP/IMAGES/…; abc </li>