On this site http://church.allthingswebdesign.com/Contact-Us.php, the links on the left work fine in every browser except IE. In IE7 i see there are javascript errors but i can't figure out what the error would be.
Here is the snippet of jQuery that is being executed on this page.
Can anyone tell me why I am seeing javascript errors in IE7?
//slides the left sidebar links when the button is clicked
$('div.links').hide();
$('div.boxes h3 a.button').click(function(e) {
var $links = $(this).parents('div.boxes');
$(this).parents().children('div.links').slideDown(500);
$links.slideDown(500).animate({
//if the left property = 0, move it to the left as many pixels as it is wide,
//else move it back to 0
left: parseInt($links.position().left,10) == 0 ? (-$links.outerWidth()-2) : 0
}, 500);
e.preventDefault();
})
//scrolls the upcoming events
function scroll() {
$('#events ol li:first').slideUp(function(){
$last = $(this).appendTo($(this).parent()).show().css('borderBottom', 'solid 1px #d1d3dc;');
$last.prev().css('borderBottom', 'solid 1px #d1d3dc');
$('#events ol li:last').css('borderBottom', 'no开发者_如何转开发ne');
});
}
Not sure if these will fix it, but they're a good start:
- Put it through JSLint.
- Remove the semicolon within your css values.
- Cache $(this) to a local variable for speed improvements
var $this = $(this);
精彩评论