0

i am using this code and it is working on all browsers without a glitch but with IE all versions it`s not working can anyone help me with this

$('a.download').each(function() {
    $(this).colorbox({href:$(this).attr('href') + ' div#download_popup',onComplete: function(){
    $('div.sociable').hide();
    $('a#share_button').click( function(){
        $('div.sociable').slideToggle().show();

    });

}})});
4

3 回答 3

1

清理代码(无论如何要好一些),看起来它缺少一个分号

$('a.download')
    .each(function() {
        $(this).colorbox({
            href: $(this).attr('href') + ' div#download_popup',
            onComplete: function() {
                $('div.sociable').hide();
                $('a#share_button').click(function() {
                    $('div.sociable').slideToggle().show();
                });
            }
        }); // RIGHT HERE
    });
于 2010-06-21T20:25:12.393 回答
1
$('a.download').each(function()
{
    $(this).colorbox(
    {
        href: $(this).attr("href") + ' div#download_popup',
        onComplete: function()
        {
            $('div.sociable').hide();
            $('a#share_button').click(function()
            {
                $('div.sociable').slideToggle().show();
            });
        }
    });
});

当您垂直对齐代码块时,更容易看到缺少大括号、括号或分号。

于 2010-06-21T20:38:51.580 回答
0
$('a.download').each(function() {
    $(this).colorbox({
        href:$(this).attr('href') + ' div#download_popup',
        onComplete: function()  {
            $('div.sociable').hide();
            $('a#share_button').click( function() {
                $('div.sociable').slideToggle().show();
            });
        }
    }) // - missing semicolon goes here
});

你少了一个分号。

于 2010-06-21T20:23:55.113 回答