Java script help! 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.
5 posters

    Java script help!

    avatar
    VoxThePie
    New Member


    Posts : 21
    Reputation : 1
    Language : English

    Solved Java script help!

    Post by VoxThePie January 4th 2015, 10:24 am

    okay so far i have made the following code... 


    Code:
    $(document).ready(function() {    
        $('td a[href^="http://********.forum.st/f"]').after('<div style="color:#BDBDBD" class="check-post"><br /><br /><br />No new posts</div>');
        $('.check-post').each(function() {
            var href = $(this).prev().attr('href');
            $(this).load(href + ' .row1.centered',function() {
                if ($(this).find('img[alt^="New posts"]').length) { $(this).html('<font color="red">New Posts</font>') }
                else { $(this).html('No new posts') }
            });
        });
    });


    for  the new posts text but now i am trying to move it somewhere else probably center or left or right how i can do it ?


    Last edited by VoxThePie on January 6th 2015, 4:02 pm; edited 1 time in total
    Mati
    Mati
    Active Poster


    Posts : 1927
    Reputation : 331
    Language : HTML, CSS & JavaScript
    Location : Forum Services

    Solved Re: Java script help!

    Post by Mati January 4th 2015, 11:08 am

    Try this in your CSS, you can change text-align left or right.

    Code:
    .check-post {
        text-align: center;
    }
    Base
    Base
    Forumaster


    Male Posts : 10383
    Reputation : 1695
    Language : English and French
    Location : United Kingdom, England

    Solved Re: Java script help!

    Post by Base January 4th 2015, 12:06 pm

    Moved to Script (Coding) Problems
    avatar
    VoxThePie
    New Member


    Posts : 21
    Reputation : 1
    Language : English

    Solved Re: Java script help!

    Post by VoxThePie January 4th 2015, 1:41 pm

    that code worked very great thanks,

    Another question though how i can add instead of a text an image?
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Java script help!

    Post by Ange Tuteur January 4th 2015, 9:36 pm

    Hi @VoxThePie,

    If you want to change the text to an image, find :
    Code:
    <font color="red">New Posts</font>

    and replace it with an image, like :
    Code:
    <img src="myimg.gif" alt="New Posts"/>

    Replace myimg.gif by the URL of your image.
    avatar
    VoxThePie
    New Member


    Posts : 21
    Reputation : 1
    Language : English

    Solved Re: Java script help!

    Post by VoxThePie January 5th 2015, 3:50 pm

    That's so great sir :O thanks

    Another request i got as well here sorry for a lot of request i got , How i can show the  Number of Topic And Posts in the category ?


    And where do i get like this  Follow us tab  ---> http://prntscr.com/5otkft
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Java script help!

    Post by Ange Tuteur January 6th 2015, 1:35 am

    I believe you should open a new topic if you have questions that are not related to this topic. Is the question in your first post solved ?
    Michael_vx
    Michael_vx
    Forumember


    Male Posts : 659
    Reputation : 29
    Language : Arabic and some English
    Location : Egypt

    Solved Re: Java script help!

    Post by Michael_vx January 6th 2015, 8:32 am

    VoxThePie wrote:okay so far i have made the following code...
    Code:
    $(document).ready(function() {    
        $('td a[href^="http://********.forum.st/f"]').after('<div style="color:#BDBDBD" class="check-post"><br /><br /><br />No new posts</div>');
        $('.check-post').each(function() {
            var href = $(this).prev().attr('href');
            $(this).load(href + ' .row1.centered',function() {
                if ($(this).find('img[alt^="New posts"]').length) { $(this).html('<font color="red">New Posts</font>') }
                else { $(this).html('No new posts') }
            });
        });
    });
    for  the new posts text but now i am trying to move it somewhere else probably center or left or right how i can do it ?
    hello
    you mind telling me what job of this Script
    im little confused cuz in the 1st place i thought this is simlliar topics or something Very Happy
    and sorry for jumping in
    Ange Tuteur
    Ange Tuteur
    Forumaster


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

    Solved Re: Java script help!

    Post by Ange Tuteur January 7th 2015, 12:08 am

    @Michael_vx, it is to add "New posts" under his categories. He's using it for the multi forums in one.

    As the topic is marked solved, Archived.