[jQuery] Cant get IE7 to work with this * click and animate
I recently condensed my code from a big mess to this (below):
I am getting no errors in Firefox/Safari... and non in IE7 > it just
doesnt work?
$(document).ready(function() {
$('#grow1, #grow2, #grow3, #grow4').hide();
$('#content1, #content2, #content3, #content4').hide();
var fSpeed = 400;
function openDiv(g, c) {
$(g).animate({width: 560}, 'slow');
$(g).animate({height: 406, top: 0}, 'slow', function(){
$(c).fadeIn(fSpeed);
});
};
function closeDiv(pG, pC, pT) {
$(pC).fadeOut(fSpeed).hide();
$(pG).animate({height: 10, top: pT}, 'slow');
$(pG).animate({width: 0}, 'slow');
};
var counter = 0;
$('#navbox .button').click(function() {
var clicked = $(this).attr('id');
var bNum = clicked[3];//get number from id tag
b = '#but' + bNum;
g = '#grow' + bNum;
c = '#content' + bNum;
if(counter == 0){
$(b).addClass('buttonSelected');
openDiv(g, c);
counter = bNum;//sets count to the button that was pressed
}
else {
var topPositions = ['0', '100', '200', '300'];
var pT = topPositions[counter - 1];
var pB = '#but' + counter;
var pG = '#grow' + counter;
var pC = '#content' + counter;
$(pB).removeClass('buttonSelected');
$(b).addClass('buttonSelected');
closeDiv(pG, pC, pT);
openDiv(g, c);
counter = bNum;//sets count to the button that was pressed
}
});
});
live link : http://danthedesignman.com/c2/html/
original js which worked in IE7: http://danthedesignman.com/c2/html/original.html
please help. thanks