这个jQuery代码中的bug在哪里?

Dav*_*nar 0 html javascript css jquery hover

我有这个代码和/**/中的部分有一些bug ...我找不到它...当我删除那部分代码时,它工作正常.

问题

$(window).load(function(){
$('#cTop').toggle(
    function(){
        showC();
    },  
    function() {
        hideC();
    }
);

$('#textDownRight').click(function(){
    window.location = 'http://nitidus-consto.kilu.org';
    hideC();
});

    /* The buggy code starts here */
$('.menuCircle').hover(
    function () {
        $(this).animate({
            width: 55%,
            height: 55%
        }, 250);
    },
    function() {
        $(this).animate({
            width: 50%,
            height: 50%
        }, 250);
    });
    /*it ends here*/
});

function hideC(){
$('#c').animate({
    width: 100,
    height: 100,
    'margin-left': '-50px',
    'margin-top': '-50px'
    },500);
$('#cTop').animate({
    'backgroundColor': 'rgb(25,25,25)'
    }, 500);}

function showC(){
$('#c').animate({
    width: 200,
    height: 200,
    'margin-left': '-100px',
    'margin-top': '-100px'
    },500);
$('#cTop').animate({
    'backgroundColor': 'rgb(50,50,50)'
    }, 500);}
Run Code Online (Sandbox Code Playgroud)

gen*_*sis 6

试试这个吧

http://jsfiddle.net/qHeMD/1/

你错过了百分数值的引号

    $(this).animate({
        width: 55% ,
        height: 55%
    }, 250);
}, function() {
    $(this).animate({
        width: 50%,
        height: 50%
    }, 250);
Run Code Online (Sandbox Code Playgroud)

应该

    $(this).animate({
        width: '55 %' ,
        height: '55 %'
    }, 250);
}, function() {
    $(this).animate({
        width: '50 %',
        height: '50 %'
    }, 250);
Run Code Online (Sandbox Code Playgroud)