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.

Java script help!

View previous topic View next topic Go down

Solved Java script help!

Post by VoxThePie on 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

VoxThePie
New Member

Posts : 21
Reputation : 1
Language : English

http://voxthepie.forum.st/forum

Back to top Go down

Solved Re: Java script help!

Post by Mati on 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;
}

Mati
Active Poster

Posts : 1885
Reputation : 283
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://footballforums.forumotion.net/

Back to top Go down

Solved Re: Java script help!

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

Moved to Script (Coding) Problems

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

Back to top Go down

Solved Re: Java script help!

Post by VoxThePie on 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?

VoxThePie
New Member

Posts : 21
Reputation : 1
Language : English

http://voxthepie.forum.st/forum

Back to top Go down

Solved Re: Java script help!

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

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Java script help!

Post by VoxThePie on 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

VoxThePie
New Member

Posts : 21
Reputation : 1
Language : English

http://voxthepie.forum.st/forum

Back to top Go down

Solved Re: Java script help!

Post by Ange Tuteur on 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 ?

Ange Tuteur
Forumaster

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

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Java script help!

Post by Michael_vx on 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

Michael_vx
Forumember

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

Back to top Go down

Solved Re: Java script help!

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

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