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.

Code wrong??

2 posters

Go down

Solved Code wrong??

Post by njaguar 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
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 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
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Code wrong??

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

no they are a user Sad
njaguar
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 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.

Code wrong?? Captu191

Auto-subscribe needs to be at '0' posts.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Code wrong??

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

Done thank you
njaguar
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 December 8th 2013, 4:51 am

Is this solved?
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Code wrong??

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

Yes
njaguar
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 December 8th 2013, 4:59 am

Topic solved and archived
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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