by Valoish October 13th 2016, 12:29 am
Well for the 145px shift to be fixed, the JS code snippet I posted above would have to be edited - however, that isn't on your end. So you'd either have to contact Ange Tuteur (since he's the one who provided the decorations) and ask whether that would be doable or not.
Or.. If you could open your devtools and paste in the styling you have in your first first post, and then screenshot the screen for me (so it looks something like
this) I can show you which element you should try targeting in your CSS Stylesheet.
PS. I tested the following JS in devtools and it seemed to work (but the existing JS you have up is conflicting with the new test I did so if you decide to try this.. Be prepared to face some flickering LOL)
What is I did was this:
Ctrl+Shift+I (dev tools) > Sources (top nav bar) > Snippets (left-side nav bar) > Right-click > New > Paste the following: - Code:
$(function() {
// Happy Halloween from Forumotion !
// If you wish, you may change the images below
var lightOff = 'http://sd-1.archive-host.com/membres/up/132720629421430912/FDF/Decoration/Halloween/skull10.png',
lightOn1 = 'http://sd-1.archive-host.com/membres/up/132720629421430912/FDF/Decoration/Halloween/skull_10.png',
lightOn2 = 'http://sd-1.archive-host.com/membres/up/132720629421430912/FDF/Decoration/Halloween/skull_11.png',
wire = document.createElement('IMG'), d = document.createElement('DIV'), lights = 0, rotate = 'positive', o = 0, o_thn = o, o_thn_reg = new RegExp('hallowLight-'+o), p = 0, p_thn = p, p_thn_reg = new RegExp('hallowLight-'+p);
wire.src = 'http://sd-1.archive-host.com/membres/up/132720629421430912/FDF/Decoration/Halloween/wire10.png';
wire.setAttribute('style','position:absolute;left:0;top:0;transform:rotate(0deg)');
d.innerHTML = '<img src="'+lightOff+'"><img src="'+lightOn1+'"><img src="'+lightOn2+'">';
d.style.display = 'none';
document.body.appendChild(wire);
document.body.appendChild(d);
newLight(10,70), newLight(80,80), newLight(155,85), newLight(235,75), newLight(320,45), newLight(400,0);
window.setInterval(function() {
if (o === 6) o = 0;
if (p === 6) p = 0;
if (o_thn === 6) { o_thn = 0; o_thn_reg = new RegExp('hallowLight-'+o_thn); }
if (p_thn === 6) { p_thn = 0; p_thn_reg = new RegExp('hallowLight-'+p_thn); }
var img = document.getElementsByTagName('IMG'), light_o = new RegExp('hallowLight-'+o), light_p = new RegExp('hallowLight-'+p);
for (i=0; i<img.length; i++) {
if (p_thn != p && p_thn_reg.test(img[i].className)) {
img[i].src = lightOff;
p_thn += 1;
p_thn_reg = new RegExp('hallowLight-'+p_thn);
}
if (light_p.test(img[i].className)) {
if (Math.abs(o - p) === 2 || Math.abs(o - p) === 3) {
img[i].src = lightOn2;
p += 1;
}
}
if (o_thn != o && o_thn_reg.test(img[i].className)) {
img[i].src = lightOff;
o_thn += 1;
o_thn_reg = new RegExp('hallowLight-'+o_thn);
}
if (light_o.test(img[i].className)) {
img[i].src = lightOn1;
o += 1;
}
}
},750);
window.setInterval(function() {
var img = document.getElementsByTagName('IMG');
for (i=0; i<img.length; i++) {
if (/hallowLight/.test(img[i].className)) {
var val = Number(img[i].style.transform.replace(/rotate\((-\d+|\d+)deg\)/,'$1'));
if (val <= -10) rotate = 'positive';
else if (val >= 10) rotate = 'negative';
if (rotate === 'positive') {
val += + 1;
img[i].style.transform = 'rotate('+val+'deg)';
}
if (rotate === 'negative') {
val += - 1;
img[i].style.transform = 'rotate('+val+'deg)';
}
}
}
if (document.body.style.marginTop != '0px') document.body.style.marginTop = '0px';
},100);
function newLight(x, y) {
var l = document.createElement('IMG');
l.src = lightOff;
l.className = 'hallowLight-'+lights;
l.setAttribute('style','position:absolute;left:'+x+'px;top:'+y+'px;');
document.body.appendChild(l);
lights += 1;
}
});
Then right-click the new snippet you made and click on
Run.You'll notice that your forum header and the halloween lights are flickering between the top of the page and slightly shifted down (this is because the current JS you have up [the one with a top margin of 145px] is conflicting with the test code I posted above [which has a top margin of 0px])
So what this shows is that your forum is being forced to shift down by 145px by default because of the coding within the
original JS.
And the line that's causing this shift in the
original JS is this one:
- Code:
if (document.body.style.marginTop != '145px') document.body.style.marginTop = '145px';
Which I replaced for the test with this one:
- Code:
if (document.body.style.marginTop != '0px') document.body.style.marginTop = '0px';
So, since the JS code overwrites the CSS of your forum I don't think you'd be able to style an element via your CSS.. Even if you try to force the styling using "!important"..