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 not working

View previous topic View next topic Go down

Solved Javascript not working

Post by Mati on November 21st 2014, 8:44 am

I'm using this Javascript to add a text before the Forum name:


Code:
$(document).ready(function(){
$('img[src="http://i59.servimg.com/u/f59/14/73/12/96/status10.png"]').replaceWith('<div id="new-mes">New</div>')
});

This is the Forum - New icon, and this is the example!
News & Announcements New

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: Javascript not working

Post by Ange Tuteur on November 21st 2014, 8:50 am

Hello Mati,

Try this :
Code:
$(function() {
 $('.forabg dl[style*="http://i59.servimg.com/u/f59/14/73/12/96/status10.png"]').append('<div id="new-mes">New</div>');
});

The images are set as backgrounds in phpbb3, so you have to check the style attribute.

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript not working

Post by Mati on November 21st 2014, 9:54 am

Oki, but how to make it so can show before the forumtitle and not before lastpost see -> http://fmfocus.forumotion.net/forum

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: Javascript not working

Post by Ange Tuteur on November 21st 2014, 10:06 am

See if this works :
Code:
$(function() {
  $('.forabg dl[style*="http://i59.servimg.com/u/f59/14/73/12/96/status10.png"]').find('a.forumtitle').append('<div id="new-mes">New</div>');
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Javascript not working

Post by Mati on November 21st 2014, 10:19 am

Perfect thank you so much for your help. Smile

Mati
Active Poster

Posts : 1873
Reputation : 281
Language : || HTML || CSS || jQuery ||
Location : At the Gym

http://elite-gaming.forumotion.net/

Back to top Go down

Solved Re: Javascript not working

Post by Ange Tuteur on November 21st 2014, 10:30 am

You're welcome

Topic archived

Have a great day. Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
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