This project is archived and is in readonly mode.

#850 ✓wontfix
Arieh

Add a removeStyle method to element

Reported by Arieh | February 17th, 2010 @ 09:32 AM | in 1.3.0 rc2 (closed)

Taken from this discussion:
http://groups.google.com/group/mootools-users/browse_thread/thread/...

This seems to me like a missing feature. There is a nice solution at the end of the discussion.

Comments and changes to this ticket

  • Sebastian Markbåge

    Sebastian Markbåge February 17th, 2010 @ 11:51 AM

    The abstraction that MooTools provides is really more in line with the "runtime" or "override" styles. You should think of it as whatever the current displaying value is, rather than what the style attribute says.

    You can't actually remove any style attribute. However you can reset it to whatever the default or the cascading styles says.

    So the method should probably be called resetStyle. Which I agree is more intuitive and better syntax than setStyle('property', '');

    However, the issue discussed above, is regarding a very specific browser issue with filters in IE. There are many more issues with combinations of filters. MooTools won't support Browser specific style properties like that.

    MooTools does use "filter" internally to simulate the opacity property though. In 2.0, getStyle('opacity') works for IE as well (doesn't now). Perhaps there should be a browser specific override for resetStyle('opacity') as well. Same goes for RGBA backgrounds, gradients etc. which can all be simulated using filters.

  • fakedarren

    fakedarren February 17th, 2010 @ 12:52 PM

    • Milestone changed from 2.0 to 1.3.0 rc2
    • State changed from “new” to “open”
    • Assigned user set to “Valerio”

    Valerio, thoughts please?

  • Fábio M. Costa

    Fábio M. Costa February 19th, 2010 @ 03:03 AM

    As Sebastian said a style cant be removed, it can be setted to its default value.
    I would close as invalid.

  • Sebastian Markbåge

    Sebastian Markbåge February 19th, 2010 @ 09:45 AM

    Yes. But the current syntax of doing so is still flawed so we should fix that.

  • Christoph Pojer

    Christoph Pojer September 4th, 2010 @ 11:22 AM

    • State changed from “open” to “wontfix”
    • Milestone order changed from “0” to “0”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

Pages