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.

Word Counter Issue

View previous topic View next topic Go down

Solved Word Counter Issue

Post by PA on July 3rd 2014, 4:37 pm

This is a relatively simple problem with a simple answer and yet my javascript is wayy to bad.

So I used forumotions word counter for my forum but I wanted it to only apply to a few forums, so I implemented:



Code:
if ($('a.nav[href^="/c1-"]').length == 0)

At the top of the code.
And it works, but I want to know how to apply it to several forums.
Like only category 1, 4 and 5.
It should just be a simple or operator but it's not working.


Last edited by PA on July 3rd 2014, 4:53 pm; edited 2 times in total

PA
Forumember

Posts : 219
Reputation : 2
Language : english

Back to top Go down

Solved Re: Word Counter Issue

Post by levy on July 3rd 2014, 4:48 pm

Hi,
From my basic Js knowledges, you can create how much if statment you want, and you don't need something else than this:
Code:
if ($('a.nav[href^="/c1-"]').length == 0)
if ($('a.nav[href^="/c4-"]').length == 0)
if ($('a.nav[href^="/c5-"]').length == 0)

I'm not very sure if it will work, you can try it or you can wait for Ange Tuteur. Smile

levy
Hyperactive

Male Posts : 2566
Reputation : 344
Language : Romanian, English
Location : Romania | Feel free to tag me into your topic if you have a problem

http://help.forumotion.com/

Back to top Go down

Solved Re: Word Counter Issue

Post by PA on July 3rd 2014, 4:55 pm

I tried it like this:

Code:
 if ($('a.nav[href^="/c1-"]').length == 0);
if ($('a.nav[href^="/c3-"]').length == 0) return;

Didnt work

PA
Forumember

Posts : 219
Reputation : 2
Language : english

Back to top Go down

Solved Re: Word Counter Issue

Post by PA on July 3rd 2014, 4:56 pm

Nevermind, it worked! Hah..
WOW

PA
Forumember

Posts : 219
Reputation : 2
Language : english

Back to top Go down

Solved Re: Word Counter Issue

Post by SLGray on July 3rd 2014, 6:44 pm

Problem solved & topic archived.


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


SLGray
Administrator
Administrator

Male Posts : 35670
Reputation : 2375
Language : English
Location : United States

http://fmthemes.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