Modify ↓
Ticket #11533 (closed bug: plugin)
Normalize css.clip
| Reported by: | SineSwiper | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | None |
| Component: | unfiled | Version: | 1.7.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The $.css('clip') command is not normalized across browsers. The "getClip" code found here should be implemented within jQuery to make sure it works in IE and others.
Furthermore, the clipTop/Bottom/Left/Right properties should also be normalized in the other direction, so that they can easily by used in animate operations.
Change History
comment:2 Changed 15 months ago by dmethvin
- Status changed from new to closed
- Resolution set to plugin
I think the pattern to be followed here is the color plugin. We don't need to add this to core, it's not a common need.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Here is an optimized code block
return (!elem.style.clip && elem.currentStyle) ? // IE refuses to return 'clip' // but has no problem with 'clipTop' and the likes // This unpleasantness reconstructs what a "good" browser would return 'rect(' + elem.currentStyle.clipTop + ', ' + elem.currentStyle.clipRight + ', ' + elem.currentStyle.clipBottom + ', ' + elem.currentStyle.clipLeft + ')' : elem.style.clip;