The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Change image individually

4 posters

Go down

In progress Change image individually

Post by TamDonCo Sat 02 Jun 2018, 16:42

Hi

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
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: Change image individually

Post by SLGray Sat 02 Jun 2018, 21:10

What is this used for?  Could you post a screenshot of it in action?


Change image individually Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51555
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

In progress Re: Change image individually

Post by TamDonCo Sat 02 Jun 2018, 21:30

SLGray wrote:What is this used for?  Could you post a screenshot of it in action?

I would like to change "mark read" icon for specific topic I do not want to read

for example, I want to "mark read" icon for topic 7550 automatically
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: Change image individually

Post by Draxion Sat 02 Jun 2018, 22:45

I checked your coding and there were a few syntax errors. Try these.
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>

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"});
  }
}
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

In progress Re: Change image individually

Post by TamDonCo Sat 02 Jun 2018, 22:52

THanks Draxion

No error but nothing happens
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: Change image individually

Post by TamDonCo Wed 06 Jun 2018, 13:45

Since no solution, I found different way

Mod : Please delete this topic

Thank You
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: Change image individually

Post by Ape Wed 06 Jun 2018, 17:40

Hello we do not delete your topic but just put it in the trash but maybe if you give it a little more time maybe @Draxion will come back and help you more or maybe some one else will.

regards APE


Change image individually Left1212Change image individually Center11Change image individually Right112
Change image individually Ape_b110
Change image individually Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19436
Reputation : 2010
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

In progress Re: Change image individually

Post by TamDonCo Wed 06 Jun 2018, 18:48

APE wrote:Hello we do not delete your topic but just put it in the trash but maybe if you give it a little more time maybe @Draxion will come back and help you more or maybe some one else will.

regards APE

OK , Thank You


How do I put in trash or only mod can do it ?
TamDonCo
TamDonCo
Forumember

Posts : 427
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

In progress Re: Change image individually

Post by Ape Wed 06 Jun 2018, 19:41

only staff can do it.


Change image individually Left1212Change image individually Center11Change image individually Right112
Change image individually Ape_b110
Change image individually Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19436
Reputation : 2010
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum