Skip to content

opts.after callback function called twice #5

Description

@cmawhorter

I'm using FF 3.5.7. I'm not sure if this bug is unique to my browser/setup or not.

To reproduce:
emile( el, 'margin-top:120px;', {duration:150, after:function() { console.log('here'); }} );

"here" is printed twice.

Also, one more unrelated thing: options.after would be significantly more useful if you made one small change to emile.js:

Change line 48 from:
if(time>finish) { clearInterval(interval); opts.after && opts.after(); }

To:
if(time>finish) { clearInterval(interval); opts.after && opts.after.call(el, opts); }

This will make "this" refer to the element being animated in the callback and also provide the options as an argument.

ex:
emile( el, 'margin-top:120px;', {duration:150, after:function() { this.className='justanimated'; }} );

Love emile! Great job!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions