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.

Category image in navigation problem

View previous topic View next topic Go down

Category image in navigation problem

Post by nigh7mare on August 21st 2013, 1:41 am

Hello,
On my forum http://horrific.forumpl.net I'm using images as category name. Here is example:

Code:
<img src="http://s19.postimg.org/wshf2kour/catfab.png" alt="Fabuła" class="subtitle-img"/>
And when I choose one of forum, I've got this:



As you see, navigation bar is broken, becouse it shows cat as image. I found a solution, but have problem to implement it.

In viewforum_body I added a script, just after {BOARD_INDEX}:

Code:
<script type="text/javascript">imgs = new Array();imgs["organizacja"] = "http://s19.postimg.org/ohvluqtar/catorg.png";imgs["akcja"] = "http://s19.postimg.org/m4do3qevn/catakc.png";imgs["fabuła"] = "http://s19.postimg.org/wshf2kour/catfab.png";$.each($(".secondarytitle h2"), function(v, k) {if(imgs[k.innerHTML.toLowerCase()] !== undefined) {k.innerHTML = '<img src="' + imgs[k.innerHTML.toLowerCase()] + '" alt="' + k.innerHTML + '" class="subtitle-img" />';}});</script>
As you see, script read "alt" attribute from cat image. Now I need implement correct varible into this line:

Code:
<td class="nav" valign="middle" width="100%"><div class="nav"><a class="nav" href="{U_INDEX}">{L_INDEX}</a>{NAV_CAT_DESC}</div></td>
I think I should replace {NAV_CAT_DESC}, but varibles {imgs}, {k.innerHTML}, don't work. Some one hae got the solution?


Last edited by nigh7mare on August 21st 2013, 1:44 am; edited 1 time in total (Reason for editing : misspells)

nigh7mare
New Member

Posts : 1
Reputation : 1
Language : Polish and English

Back to top Go down

Re: Category image in navigation problem

Post by Sir Chivas™ on September 1st 2013, 10:49 am

Hi,

None will work, CSS nor JavaScript will do it, since it's the same image. Sorry, mate. Your only option is to resize the image itself.

Sir Chivas™
Support Moderator
Support Moderator

Male Posts : 6783
Reputation : 430
Language : EN, FR, ES
Location : || CSS || HTML || Graphics Designs || Support ||

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