#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)
Change History (6)
Changed 12 years ago by
Attachment: | jquery.effects-clip-centered.js added |
---|
comment:1 Changed 12 years ago by
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 12 years ago by
Status: | new → open |
---|
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 12 years ago by
Resolution: | → duplicate |
---|---|
Status: | open → closed |
comment:5 Changed 11 years ago by
Milestone: | 1.later → 1.9 |
---|
Clip Effect allowing for centered DIV