Javascript for an image? 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.
3 posters

    Javascript for an image?

    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Javascript for an image?

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

    Hello, I would like to know if I can have a javascript for this photo: https://i.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
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Javascript for an image?

    Post by Ange Tuteur 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;
    }
    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Javascript for an image?

    Post by brandon_g 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 is wrap around a rank?

    -Thanks - Brandon
    SLGray
    SLGray
    Administrator
    Administrator


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

    Solved Re: Javascript for an image?

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

    The first part is the rank title.



    Javascript for an image? Slgray10

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


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Javascript for an image?

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

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



    Javascript for an image? Brando10
    Remember to mark your topic Javascript for an image? Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    Javascript for an image? Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Javascript for an image?

    Post by Ange Tuteur 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.
    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Javascript for an image?

    Post by brandon_g 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!*



    Javascript for an image? Brando10
    Remember to mark your topic Javascript for an image? Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    Javascript for an image? Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Javascript for an image?

    Post by Ange Tuteur 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)
    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Javascript for an image?

    Post by brandon_g 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



    Javascript for an image? Brando10
    Remember to mark your topic Javascript for an image? Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    Javascript for an image? Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Javascript for an image?

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

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


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Javascript for an image?

    Post by brandon_g 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



    Javascript for an image? Brando10
    Remember to mark your topic Javascript for an image? Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    Javascript for an image? Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Javascript for an image?

    Post by Ange Tuteur 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 }
    brandon_g
    brandon_g
    Manager
    Manager


    Male Posts : 10113
    Reputation : 923
    Language : English
    Location : USA

    Solved Re: Javascript for an image?

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

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



    Javascript for an image? Brando10
    Remember to mark your topic Javascript for an image? Solved15 when a solution is found.
    General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

    Javascript for an image? Scre1476
    Team Leader
    Review Section Rules | Request A Review | Sticker Points
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Javascript for an image?

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

    You're welcome ^^

    Topic archived

    Happy holidays santa