开发者

jQuery errors in IE7

开发者 https://www.devze.com 2023-01-12 15:28 出处:网络
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

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:

  1. Put it through JSLint.
  2. Remove the semicolon within your css values.
  3. Cache $(this) to a local variable for speed improvements var $this = $(this);
0

精彩评论

暂无评论...
验证码 换一张
取 消