Hey guys,
i tried to script a new slider for my website which shows & hides my login-panel.
You can see it on:
http://lan-maniac.com/?admin=1
(You need the ?admin=1 after it to see the construction-site.)
In FireFox the Slider on the top will hide & show after pressing the arrow under it. Its all workin perfectly there. But on Chrome i got a problem. The arrow is moving down all the time & when u check the console of chrome (where the console.log() comments appear) you can see the outputs which were made of my script.
Here it is:
- $('a#topbar_button_toggle').click(function() {
$('div#header_lanmaniac_topbar').slideToggle();
if($('#topbar_button').css('top') == '0px') {
value = '-52';
console.log('Minus' + value) + ' , Top: ' + $('#topbar_button').css('top');
} else {
value = '52';
console.log('Plus' + value) + ' , Top: ' + $('#topbar_button').css('top');
}
$('#topbar_button').animate({
'top' : "+="+value+"px",
});
console.log(value);
});
(never mind the outputs. I´ll delete them after it works perfect.)
The code is the same in FF & chrome so there must be a problem with chrome & jquery. But i dont know where? As u can see, the arrow is moving down the whole time, doesnt matter if it should go up or not.
Hope u guys understand my problem & know the solution.
Schrubber