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 14 users online :: 0 Registered, 0 Hidden and 14 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
Script breaking menu and widget floating button
Page 1 of 1 • Share
Good day!
I joined because I really liked the practicality that Edge offered and decided to give it a try. So far I'm enjoying it a lot! But sadly when I tried to ad a few simple codes on my forum they broke the floating buttons for the navigation and the widget. One of those codes is this one:
Javascript for all pages
HTML for widget:
Even if I don't publish the widget, the script break the floating buttons by itself.
The code above is meant to show messages in a widget by the group of the user who's reading it (a feature I don't know why the system doesn't have yet).
It seems for me that any code "adding" something on the page will break the buttons.
EDIT I've tried making this code work for 30 min now and out of nothing (even when I cleaned my cache every time I updated it) it seems to have stopped breaking things, right after I posted here. So delete my topic, please!
I joined because I really liked the practicality that Edge offered and decided to give it a try. So far I'm enjoying it a lot! But sadly when I tried to ad a few simple codes on my forum they broke the floating buttons for the navigation and the widget. One of those codes is this one:
Javascript for all pages
- Code:
$(function() {
// CONTEÚDO POR GRUPO
var PROFESSORES = 'Mensagem';
var FUNCIONARIOS = 'Mensagem';
var ESTUDANTES = 'Mensagem';
var VESTIBULANDO = 'Mensagem';
var MUNDOBRUXO = 'Mensagem';
// Vars
var idUser = _userdata["user_id"];
console.log(idUser);
// Escondido
$('body').prepend('<div id="Hancki" style="display:none;"><span id="corUser"></span></div>');
// Função
$.get('/u' + idUser + '', {}, function(data) {
$('#Hancki #corUser').html($(data).find('#navstrip li[style="float:none;"] span[style*="color"]'));
}).done(function() {
var corUsuario = $('#Hancki #corUser span').attr('style');
console.log(corUsuario);
// LISTAGEM DOS GRUPOS
if (corUsuario == 'color:#9524FF') {
// PROFESSORES
console.log('Você é dos Professores.');
$('#mensagemGrupo').html(PROFESSORES);
} else if (corUsuario == 'color:#D630FF') {
// FUNCIONÁRIOS
console.log('Você é dos Funcionários.');
$('#mensagemGrupo').html(FUNCIONARIOS);
} else if (corUsuario == 'color:#42A819') {
// ESTUDANTES
console.log('Você é dos Estudantes.');
$('#mensagemGrupo').html(ESTUDANTES);
} else if (corUsuario == 'color:#DB2C72') {
// VESTIBULANDO
console.log('Você é do Vestibulando.');
$('#mensagemGrupo').html(VESTIBULANDO);
} else if (corUsuario == 'color:#2C9EDB') {
// MUNDO BRUXO
console.log('Você é do Mundo Bruxo.');
$('#mensagemGrupo').html(MUNDOBRUXO);
} else {
console.log('Você é um Administrador!');
}
}).fail(function() {
alert('A mensagem personalizada para os grupos não foi carregada. Contacte a administração.');
$('#Hancki').remove();
});
});
HTML for widget:
- Code:
<div id="mensagemGrupo"></div>
Even if I don't publish the widget, the script break the floating buttons by itself.
The code above is meant to show messages in a widget by the group of the user who's reading it (a feature I don't know why the system doesn't have yet).
It seems for me that any code "adding" something on the page will break the buttons.
EDIT I've tried making this code work for 30 min now and out of nothing (even when I cleaned my cache every time I updated it) it seems to have stopped breaking things, right after I posted here. So delete my topic, please!
Last edited by dannig on Mon 17 Apr 2017, 14:35; edited 1 time in total
Ah I see. It may be due to the script not supporting Forumactif Edge ; FAE uses a slightly different markup and selectors. The only notable thing that should be worth changing is this selector
. I think that targets the breadcrumbs, so you could us the
class for FAE.
If the widgets, quick panel, and other plugins disappear or appear broken, it's usually do to a javascript error. Some errors, if severe, can halt all other scripts on the page. This typically happens with code executed within jQuery's document ready function, because jQuery queues any functions that are called with it. So if any script using document ready has an error, it'll prevent all other scripts in the queue from being executed.
|
|
If the widgets, quick panel, and other plugins disappear or appear broken, it's usually do to a javascript error. Some errors, if severe, can halt all other scripts on the page. This typically happens with code executed within jQuery's document ready function, because jQuery queues any functions that are called with it. So if any script using document ready has an error, it'll prevent all other scripts in the queue from being executed.
- 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