Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
by Ange Tuteur Tue 03 Sep 2019, 11:49
» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21
» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28
» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15
» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11
» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24
» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58
» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50
» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22
» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12
» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10
» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51
» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11
» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19
» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34
Recent Tutorials
Top posting users this month
Top Achievers
Who is online?
In total there are 40 users online :: 0 Registered, 0 Hidden and 40 Guests :: 1 Bot
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
None
Most users ever online was 515 on Tue 14 Sep 2021, 15:24
[SOLVED] category toggle problem
Page 1 of 1 • Share
Hello i have a small problem again LOL
i have installed the category toggle code and it was all working fine until the other day then Bam out of the blue it stopped working when i did a page refresh Then today i logged in and my toolbar was gone.
so after i cleared my browser the toolbar come back again. but the category toggle still don't work right.
and every time i use the category toggle it makes my toolbar go again.
can some one take a look at this for me please.
forum address : http://www.achatworld.com/
much thanks to any one that can fix this for me
i have installed the category toggle code and it was all working fine until the other day then Bam out of the blue it stopped working when i did a page refresh Then today i logged in and my toolbar was gone.
so after i cleared my browser the toolbar come back again. but the category toggle still don't work right.
and every time i use the category toggle it makes my toolbar go again.
can some one take a look at this for me please.
forum address : http://www.achatworld.com/
much thanks to any one that can fix this for me
@Ape there's definitely an error with the toggler itself..
Have you tried replacing your current toggler with this one ?
Have you tried replacing your current toggler with this one ?
- Code:
$(function() {
// start up variables
var less = 'http://2img.net/i/fa/m/tabs_less1.gif', // - image
more = 'http://2img.net/i/fa/m/tabs_more1.gif', // + image
a = $('.forabg', document.getElementById('main-content'), i = 0, f, button, list, dd;
for (; f = a[i]; i++) {
// create and get the needed elements
list = f.getElementsByTagName('UL'); // header[0] and category[1]
button = document.createElement('IMG'); // toggler
dd = document.createElement('DD'); // toggler container
button.src = less;
button.style.cursor = 'pointer';
button.id = 'fa_toggle-' + i;
list[1].id = 'fa_catg-' + i;
// if the category is hidden in the cookie, we'll change the image and hide it
if (my_getcookie('fa_catg-' + i) == 'hidden') {
button.src = more;
list[1].style.display = 'none';
}
// yummy toggle logic
button.onclick = function() {
// get the current id number and category for manipulation
var id = this.id.replace(/.*?(\d+)/, '$1'), catg = document.getElementById('fa_catg-' + id);
// if the category is hidden, we'll update the cookie and show it
// the else statement does the opposite ;)
if (/none/.test(catg.style.display)) {
this.src = less;
catg.style.display = 'block';
my_setcookie('fa_catg-' + id, 'shown');
} else {
this.src = more;
catg.style.display = 'none';
my_setcookie('fa_catg-' + id, 'hidden');
}
};
dd.appendChild(button); // add the button to its container
list[0].firstChild.firstChild.appendChild(dd); // and finally add it to the category header
}
});
// créé par ange tuteur
I just added that code and now its gone i have no buttons at all
its ok i have added this one for now
http://help.forumotion.com/t102749-category-toggle-all-forums?highlight=Category
just updated the icons to fit my forum
its ok i have added this one for now
http://help.forumotion.com/t102749-category-toggle-all-forums?highlight=Category
just updated the icons to fit my forum
ok i have now found a problem with my code i used on the last post
Now i have added this code
i have found that the mobile toggle is not on the home page so i can't log in unless i got to a topic then the little lines come up can some one fix this code please ?
Now i have added this code
- Code:
/**************************************************************************
Category Toggle
***************************************************************************/
/***
* Application: toggle Category
* Description: Show/hide categories!
* Version: 0.02632015-jq1.9.1
* RC1 (Release candidate 1!) - Invision
* Author: JScript - 2015/03/26 - based on Invision.js
* This work is free. You can redistribute it and/or modify it
* under the terms of the WTFPL, Version 2
*/
$(function() {
("JScript <jscriptbrasil at live dot com>, based on Invision.js");
var style = document.createElement("style"),
/* Versions:|phpBB2----------------------------------------| |phpBB3-------------| |PunBB-----------------| |Invision already have it!| */
oCat = $('#content-container .three-col td:eq(1) .forumline, #main-content .forabg, #main-content .main-head'),
oThis = null,
oTemp = null,
sEval = '';
style.type = "text/css";
style.innerHTML =
'.contract, .expand {' +
' background: url("http://i35.servimg.com/u/f35/13/25/37/43/mine10.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
' cursor: pointer;' +
' float: right;' +
' padding-right: 55px;' +
' padding-top: 10px;' +
' padding-bottom: 19px;' +
' margin-top: -35px;' +
'}' +
'.expand {' +
' background: url("http://i35.servimg.com/u/f35/13/25/37/43/add10.png") no-repeat scroll 50% 50% rgba(0, 0, 0, 0);' +
'}';
document.getElementsByTagName("head")[0].appendChild(style);
switch (oCat[0].className) {
case 'forumline': //phpBB2
sEval = "oTemp = oThis.find('tr').first();oTemp.addClass('title-bar');" +
"oTemp.find('th:last').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\" style=\"margin-top: -15px;\"> </div>');" +
"oThis.find('tr').not('.title-bar').addClass('c' + i);";
break;
case 'forabg': //phpBB3
sEval = "oThis.find('ul.topiclist:first dl.icon').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\"> </div>');" +
"oThis.find('ul.topiclist.forums').attr('id', 'c' + i);";
break;
case 'main-head': //PunBB
sEval = "oThis.find('h2').append('<div onclick=\"toggleCategory(\\'c' + i + '\\');\" id=\"bc' + i + '\" class=\"contract\"> </div>');" +
"oThis.next().attr('id', 'c' + i);";
break;
}
for (var i = 0, len = oCat.length; i < len; i++) {
oThis = $(oCat[i]);
eval(sEval);
}
initCategories();
});
// by invision.js
function initCategories() {
var id;
cookies = document.cookie.split('; ');
for (var i = 0; i < cookies.length; i++) {
if (cookies[i].charAt(0) == '_') {
cookie = cookies[i].split('=');
if (cookie[1] == '1') {
id = cookie[0].substring(1);
if (document.getElementById(id)) {
toggleCategory(id)
}
}
}
}
}
// by invision.js, modified by JScript
function toggleCategory(id) {
var obj = document.getElementById(id);
var button = document.getElementById('b' + id);
if (obj) {
var toggle = obj.style.display == 'none';
obj.style.display = toggle ? '' : 'none';
} else {
var elems = document.getElementsByClassName(id);
for (var i = 0, len = elems.length; i < len; i++) {
var toggle = elems[i].style.display == 'none';
elems[i].style.display = toggle ? '' : 'none';
}
}
button.className = toggle ? 'contract' : 'expand';
my_setcookie('_' + id, toggle ? '' : '1', true);
return false
}
/*
▲ -> contract
▼ -> expand
*/
i have found that the mobile toggle is not on the home page so i can't log in unless i got to a topic then the little lines come up can some one fix this code please ?
the code works fine on the main forum right now on my laptop but when i go in to the mobile phone it makes the little tab on the top of the page go away as you can see in the screen shot there is no little lines to log in on the top right
I see.
Find the first instance of :
and replace it with this :
That should prevent the script from executing on the mobile version.
Find the first instance of :
- Code:
$(function() {
and replace it with this :
- Code:
$(function() {
if (_userdata.page_desktop) return;
That should prevent the script from executing on the mobile version.
- Sponsored content
Similar topics
Create an account or log in to leave a reply
You need to be a member in order to leave a reply.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum