[jQuery] Ugly code causing problems in IE
Hello,
I am a jquery newbie, and I am trying to get an effect off the ground.
It works fine in Mozilla but not in IE.
Does anyone know what I'm doing wrong. Many apologies for the ugly
code - I'm not really a jquery programmer, so not sure how to make it
more efficient.
At the moment, I'm just wondering why it doesn't work. The page is at:
http://m1.cust.educ.ubc.ca/newsite/
The code is:
$(document).ready(function(){
q1 = {
init: function() {
$(".loader1").click(function() {
$("#fader").fadeOut('slow', function() {
$(this).load('homepage_text/0.php').fadeIn('slow');
});
$("#featureBanner").fadeOut('slow', function() {
$(this).load('homepage_images/0.php').fadeIn('slow');
});
$("#over").css({color: 'white', backgroundColor: '#2e4468',
textDecoration: 'underline'});
$("#other").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other2").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other3").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
});
}
}
q1.init();
q2 = {
init: function() {
$(".loader2").click(function() {
$("#fader").fadeOut('slow', function() {
$(this).load('homepage_text/1.php').fadeIn('slow');
});
$("#featureBanner").fadeOut('slow', function() {
$(this).load('homepage_images/1.php').fadeIn('slow');
});
$("#over").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other").css({color: 'white', backgroundColor: '#2e4468',
textDecoration: 'underline'});
$("#other2").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other3").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
});
}
}
q2.init();
q3 = {
init: function() {
$(".loader3").click(function() {
$("#fader").fadeOut('slow', function() {
$(this).load('homepage_text/2.php').fadeIn('slow');
});
$("#featureBanner").fadeOut('slow', function() {
$(this).load('homepage_images/2.php').fadeIn('slow');
});
$("#over").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other2").css({color: 'white', backgroundColor: '#2e4468',
textDecoration: 'underline'});
$("#other3").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
});
}
}
q3.init();
q4 = {
init: function() {
$(".loader4").click(function() {
$("#fader").fadeOut('slow', function() {
$(this).load('homepage_text/3.php').fadeIn('slow');
});
$("#featureBanner").fadeOut('slow', function() {
$(this).load('homepage_images/3.php').fadeIn('slow');
});
$("#over").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other2").css({color: '#242f37', backgroundColor: '#A4BEDF',
textDecoration: 'none'});
$("#other3").css({color: 'white', backgroundColor: '#2e4468',
textDecoration: 'underline'});
});
}
}
q4.init();
});