当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery selectors - select li having images

问题描述:

I want to apply ifixpng function, for li having images , but i cannot select the below image and apply ifixpng function , how can i select

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

网友答案:

Isn't better to have the style in css?

And it's easier to select it

css:

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

js: $('li .image').some_func()

Solution:

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

and the html should be with normal ':

<li style='list-style-image: url("images.abbottnutrition.com/Glucerna.com.br-HCP/IMAGES/…; abc </li>
分享给朋友:
您可能感兴趣的文章:
随机阅读: