[jQuery] Troubles with bind('click') in IE <cant seem to get it right>
Hi I have been banging my head over a small piece of jQuery I have written to
use for navigation.
basically I am binding a click function to <li>,
based on what <li> was clicked it opens its respected "animation div", then
loads content
I work on a mac desktop, non intel based, which I am unable to use to debug
IE. I have to run to remote locations to test, then run back and attempt to
fix. However the local library doesn't allow me to debug what soever, so I
have ran myself into a corner!
LIVE : http://danthedesignman.com/c2/html/
$(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)});
if(counter == 2){
$('#caseMenu').show();
$('#case').hide();
}
};
function closeDiv(pG, pC, pT) {
$(pC).fadeOut(fSpeed).hide();
$(pG).animate({height: 10, top: pT}, 'slow');
$(pG).animate({width: 0}, 'normal');
};
var counter = 0;
$('#navbox .button').bind('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
}
});
});
please let me know if you see any reason why this bit of code would not be
linking to the <li>'s in IE?
thanks!
--
View this message in context: http://www.nabble.com/Troubles-with-bind%28%27click%27%29-in-IE-%3Ccant-seem-to-get-it-right%3E-tp16275997s27240p16275997.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.