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.

Category image in navigation problem

2 posters

Go down

Category image in navigation problem Empty Category image in navigation problem

Post by nigh7mare 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:

Category image in navigation problem Proble10

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)
avatar
nigh7mare
New Member

Posts : 1
Reputation : 1
Language : Polish and English

Back to top Go down

Category image in navigation problem Empty Re: Category image in navigation problem

Post by Sir Chivas™ 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™
Sir Chivas™
Helper
Helper

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

https://aforums.org

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum