The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Code wrong??

View previous topic View next topic Go down

Solved Code wrong??

Post by njaguar on December 8th 2013, 2:52 am

Why does the first two codes work but the last doesn't? there the same....

Code:
$(function() {
        if($('a[href="/u1"] span strong')){
                    $('a[href="/u1"] span strong').after('<img src="http://forums.d2jsp.org/images/s55.png" border="0" />');
            }
        });

$(function() {
        if($('a[href="/u3"] span strong')){
                    $('a[href="/u3"] span strong').after('<img src="http://www.d3jsp.org/images/stars/92.gif" border="0" />');
            }
        });

$(function() {
if($('a[href="/u8"] span strong')){
            $('a[href="/u8"] span strong').after('<img src="http://cdn2.iconfinder.com/data/icons/ledicons/crown.png" border="0" />');
    }
});

njaguar
Forumember

Male Posts : 113
Reputation : 1
Language : English
Location : United Kingdom

http://d4jsp.forumotion.com/

Back to top Go down

Solved Re: Code wrong??

Post by Ange Tuteur on December 8th 2013, 3:51 am

Hello njaguar,

I do not think javascript is necessary for this. You can use CSS instead to add an image to users.

Code:
a[href="/u1"] span strong:after { content:url(http://forums.d2jsp.org/images/s55.png) }

a[href="/u3"] span strong:after { content:url(http://www.d3jsp.org/images/stars/92.gif) }

a[href="/u8"] span strong:after { content:url(http://cdn2.iconfinder.com/data/icons/ledicons/crown.png) }
For user #8 are they in a group? These selectors are for users that are bold and colored. i.e. in a group. If they're not in a group then the selectors will not work.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Code wrong??

Post by njaguar on December 8th 2013, 4:21 am

no they are a user Sad

njaguar
Forumember

Male Posts : 113
Reputation : 1
Language : English
Location : United Kingdom

http://d4jsp.forumotion.com/

Back to top Go down

Solved Re: Code wrong??

Post by Ange Tuteur on December 8th 2013, 4:44 am

Then you can create a default group that members join upon registration. It should have the following options, and should color the group members.



Auto-subscribe needs to be at '0' posts.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Code wrong??

Post by njaguar on December 8th 2013, 4:50 am

Done thank you

njaguar
Forumember

Male Posts : 113
Reputation : 1
Language : English
Location : United Kingdom

http://d4jsp.forumotion.com/

Back to top Go down

Solved Re: Code wrong??

Post by Ange Tuteur on December 8th 2013, 4:51 am

Is this solved?

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Code wrong??

Post by njaguar on December 8th 2013, 4:55 am

Yes

njaguar
Forumember

Male Posts : 113
Reputation : 1
Language : English
Location : United Kingdom

http://d4jsp.forumotion.com/

Back to top Go down

Solved Re: Code wrong??

Post by Ange Tuteur on December 8th 2013, 4:59 am

Topic solved and archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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