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.
The forum of the forums
4 posters

    Change image individually

    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    In progress Change image individually

    Post by TamDonCo June 2nd 2018, 5:42 pm

    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
    SLGray
    SLGray
    Administrator
    Administrator


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

    In progress Re: Change image individually

    Post by SLGray June 2nd 2018, 10:10 pm

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


    Posts : 427
    Reputation : 2
    Language : English

    In progress Re: Change image individually

    Post by TamDonCo June 2nd 2018, 10:30 pm

    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
    Draxion
    Draxion
    Helper
    Helper


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

    In progress Re: Change image individually

    Post by Draxion June 2nd 2018, 11:45 pm

    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"});
      }
    }
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    In progress Re: Change image individually

    Post by TamDonCo June 2nd 2018, 11:52 pm

    THanks Draxion

    No error but nothing happens
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    In progress Re: Change image individually

    Post by TamDonCo June 6th 2018, 2:45 pm

    Since no solution, I found different way

    Mod : Please delete this topic

    Thank You
    Ape
    Ape
    Administrator
    Administrator


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

    In progress Re: Change image individually

    Post by Ape June 6th 2018, 6:40 pm

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


    Posts : 427
    Reputation : 2
    Language : English

    In progress Re: Change image individually

    Post by TamDonCo June 6th 2018, 7:48 pm

    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 ?
    Ape
    Ape
    Administrator
    Administrator


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

    In progress Re: Change image individually

    Post by Ape June 6th 2018, 8:41 pm

    only staff can do it.



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

      Current date/time is November 13th 2024, 7:11 pm