Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#6120 closed bug (duplicate)

Clip animation does not work on centered elements (margin: 0 auto)

Reported by: ryanwheale Owned by:
Priority: major Milestone: 1.9.0
Component: ui.effects.* (individual effect) Version: 1.8.5
Keywords: clip effect centered div Cc:
Blocked by: Blocking:

Description

#myDiv { width:500px; margin:0 auto; }

When you animate an element with this syntax:

$('#myDiv').show('clip',{direction:'horizontal'},500);

... the behavior is not as expected.

Chrome: expands from far left instead of center FF, IE7, IE8: expands from left, then jumps to center

I have attached my fix. Take note of the new variable "centered". My fix works for my current project, but has not gone through a lot of testing. If I can clean it up, I will post back here.

Attachments (1)

jquery.effects-clip-centered.js (1.7 KB) - added by ryanwheale 9 years ago.
Clip Effect allowing for centered DIV

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by ryanwheale

Clip Effect allowing for centered DIV

comment:1 Changed 9 years ago by ryanwheale

Just making some notes on what I have seen so far:

Some browsers return the calculated margins, as opposed to "auto". In these situations, the effect degrades to it's previous behavior. So far, Opera 10.6 is the only browser I have seen that is returning calculated margins.

comment:2 Changed 9 years ago by Corey Frang

Status: newopen

ryan - any other updates here? I'm not sure what happened to your attachment, but can you post a link?

jsFiddled: http://jsfiddle.net/gnarf/rbsKe/

comment:3 Changed 9 years ago by Corey Frang

Resolution: duplicate
Status: openclosed

comment:4 Changed 9 years ago by Corey Frang

Duplicate of #4228.

comment:5 Changed 8 years ago by Scott González

Milestone: 1.later1.9
Note: See TracTickets for help on using tickets.