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.

Javascript for an image?

View previous topic View next topic Go down

Solved Javascript for an image?

Post by brandon_g on December 20th 2014, 2:33 am

Hello, I would like to know if I can have a javascript for this photo: https://i39.servimg.com/u/f39/18/21/41/30/f6011.png ? I was told by@ange to make a need thread on the support forum!

Thanks Brandon!


Last edited by brandon_g on December 21st 2014, 1:37 am; edited 1 time in total

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by Ange Tuteur on December 20th 2014, 2:40 am

Hello @brandon_g,

Create a new rank with the following content, or wrap your current rank with it.
Code:
<span class="staff-rank">YOUR RANK HERE</span>

Next go to Modules > JavaScript codes management > create a new script

Title : Your choice
Placement : In all the pages
Code:
$(function() {
 $('.post:has(.staff-rank)').addClass('staff-post');
});

Then use CSS to style the posts :
Display > Colors > CSS stylesheet
Code:
.post.staff-post {
 background-image:url(http://i39.servimg.com/u/f39/18/21/41/30/f6011.png);
 background-repeat:no-repeat;
 background-position:left bottom;
}

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript for an image?

Post by brandon_g on December 20th 2014, 2:02 pm

Hello Ange, I did everything you said but it is still not appearing. The only thing I may have messed up on is wrapping the image around the rank. How do I do this? Do I put it as the actual title or the rank image itself. What I am asking really iswrap around a rank?

-Thanks -Brandon

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by SLGray on December 20th 2014, 7:45 pm

The first part is the rank title.


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


SLGray
Administrator
Administrator

Male Posts : 36747
Reputation : 2449
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by brandon_g on December 20th 2014, 11:26 pm

Why is the code not working? I do not have my gradient I followed Ange's steps precisely!


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by Ange Tuteur on December 20th 2014, 11:35 pm

It could be an incompatibility in your forum version. What is the version of your forum ?
Display > Choose a theme > Version

or post your forum link if you're not sure.

By wrap, I mean wrap these tags around your rank title :
Code:
<span class="staff-rank">YOUR RANK HERE</span>

Where YOUR RANK HERE is, is where your rank name should be.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript for an image?

Post by brandon_g on December 20th 2014, 11:45 pm

@Ange I already know what verision my forum operates on: its PHPBB2. And it has been since it was created! Wink

It even says on my username: *has not looked his username in so long he forgot this fact!*


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by Ange Tuteur on December 20th 2014, 11:52 pm

I need to ask, because members profiles are not always true.

Replace your CSS with this :
Code:
.post.staff-post td { background:none }
.post.staff-post { background:url(http://i39.servimg.com/u/f39/18/21/41/30/f6011.png) no-repeat left bottom #1d1d1d }

Edit by brandon_g: Use the above css if your forum version is phpbb2


Last edited by brandon_g on January 19th 2016, 4:36 pm; edited 1 time in total (Reason for editing : To provide clarity for users who view and use this topic in the future)

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript for an image?

Post by brandon_g on December 21st 2014, 12:10 am

@ange I know that was my smartmouth at work again!

I have replaced the CSS code with the one you just gave me but the gradient still not showing. Sad


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by Ange Tuteur on December 21st 2014, 12:12 am

Have you wrapped your rank with the following tags ?
Code:
<span class="staff-rank">YOUR RANK HERE</span>

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript for an image?

Post by brandon_g on December 21st 2014, 1:01 am

@ Ange it works now.... but it only covers half of my posts, is it possible to drag all the across.

i wanna post a screen shot, but it would not work. So I will just put the link to show you what I mean:Click Here


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by Ange Tuteur on December 21st 2014, 1:07 am

Replace your CSS with this :
Code:
.post.staff-post td { background:none }
.post.staff-post { background:url(http://i39.servimg.com/u/f39/18/21/41/30/f6011.png) no-repeat left bottom / 100% 100% #1d1d1d }

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript for an image?

Post by brandon_g on December 21st 2014, 1:34 am

That fixed it! Thanks again Ange! SOLVED Very good Very good .


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5358
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Javascript for an image?

Post by Ange Tuteur on December 21st 2014, 1:40 am

You're welcome ^^

Topic archived

Happy holidays santa

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
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