Javascript not working Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
2 posters

    Javascript not working

    Mati
    Mati
    Active Poster


    Posts : 1932
    Reputation : 333
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Javascript not working

    Post by Mati November 21st 2014, 8:44 am

    I'm using this Javascript to add a text before the Forum name:


    Code:
    $(document).ready(function(){
    $('img[src="http://i59.servimg.com/u/f59/14/73/12/96/status10.png"]').replaceWith('<div id="new-mes">New</div>')
    });

    This is the Forum - New icon, and this is the example!
    Javascript not working Status10 News & Announcements New
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Javascript not working

    Post by Ange Tuteur November 21st 2014, 8:50 am

    Hello Mati,

    Try this :
    Code:
    $(function() {
      $('.forabg dl[style*="http://i59.servimg.com/u/f59/14/73/12/96/status10.png"]').append('<div id="new-mes">New</div>');
    });

    The images are set as backgrounds in phpbb3, so you have to check the style attribute.
    Mati
    Mati
    Active Poster


    Posts : 1932
    Reputation : 333
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: Javascript not working

    Post by Mati November 21st 2014, 9:54 am

    Oki, but how to make it so can show before the forumtitle and not before lastpost see -> http://fmfocus.forumotion.net/forum
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Javascript not working

    Post by Ange Tuteur November 21st 2014, 10:06 am

    See if this works :
    Code:
    $(function() {
      $('.forabg dl[style*="http://i59.servimg.com/u/f59/14/73/12/96/status10.png"]').find('a.forumtitle').append('<div id="new-mes">New</div>');
    });
    Mati
    Mati
    Active Poster


    Posts : 1932
    Reputation : 333
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: Javascript not working

    Post by Mati November 21st 2014, 10:19 am

    Perfect thank you so much for your help. Smile
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Javascript not working

    Post by Ange Tuteur November 21st 2014, 10:30 am

    You're welcome Javascript not working 1852325475

    Topic archived

    Have a great day. Smile