Skip to content

$.animate some defined properties can't work on generic object #514

@HolaMan

Description

@HolaMan

Not sure if $.animate intend to support generic object.
The code below raise exception
"Uncaught TypeError: Cannot use 'in' operator to search for 'opacity' in undefined"
//===========================
var s = { opacity: 1 };
$(s).animate({opacity: 0}, 5000);

But it try to use $.css to set the opacity. So if I just change to other name
//===========================
var s = { opacity2: 1 };
$(s).animate({opacity2: 0}, 5000);
and it works.

I guess it might be resolvable If jquery can detect if it's the html object or not.
But not sure if $.animate intend to only support html object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions