Hi
Is it possible to change image individually, not all
Example
I have same image in 4 rows, suppose I want to change one them such as row 2
I use this code but it changes all of them
it does not work but if I take out "no-repeat" , it works but change all 4 rows
Is it possible to change image individually, not all
Example
- Code:
<li class="row row1" ><dl class="icon" style="background-image:url('http://2img.net/s/t/20/71/96/i_folder.gif');"></dl></li>
<li class="row row2" ><dl class="icon" style="background-image:url('http://2img.net/s/t/20/71/96/i_folder.gif');</dl></li>
<li class="row row1" ><dl class="icon" style="background-image:url('http://2img.net/s/t/20/71/96/i_folder.gif');</dl></li>
<li class="row row2" ><dl class="icon" style="background-image:url('http://2img.net/s/t/20/71/96/i_folder.gif');</dl></li>
I have same image in 4 rows, suppose I want to change one them such as row 2
I use this code but it changes all of them
- Code:
for ( var i = 0, r = document.getElementsByClassName('row'); i < r.length; i++ ) {
if (i ==2) {
$(".icon").css({"background-image" : "url(http://2img.net/s/t/20/71/96/i_folder_new_hot.gif)", no-repeat });
}
}
it does not work but if I take out "no-repeat" , it works but change all 4 rows