Hi Jeremy,

It's always great to see such passion among developers about jQuery,  
so thanks for contributing to the conversation. There are a lot of  
features that would make JavaScript easier if they were added to  
jQuery, but it's always important to weigh the relative benefit  
against the cost of increased file size and API bloat. If there is  
another easy way to accomplish a task without adding more bytes to the  
core and another method to the API, then we usually just stick with  
that other way. Sometimes, though, when features are so overwhelmingly  
in demand, such as those in the Dimensions plugin, they are eventually  
rolled into the jQuery core. We now  
have .offset(), .innerHeight(), .outerHeight() (and their width  
counterparts), etc., but that is because there was a demonstrable need  
for these things from many, many developers.

There are other JavaScript libraries that try to offer the kitchen  
sink. jQuery has a different approach. It offers just enough to make  
the vast majority of your JavaScript tasks easier and more efficient,  
and it provides a simple, yet powerful plugin API so that developers  
can create (and share) their own extensions to the core.

When it comes right down to it, it's a matter of philosophy. However,  
if you write a little plugin for your css deletion, and if enough  
other developers use it and request that it be added to core, I'm sure  
that the core developers will take those requests seriously.

--Karl

____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Dec 14, 2008, at 8:05 AM, jez9999 wrote:

>
> Why?  Is not jQuery a library to make development with Javascript
> easier?  This is a small, simple feature which would do just that.
> Technically, everything that jQuery does can be done without jQuery.
> It's just much more difficult.  Therefore jQuery is purely about
> convenience.  This is a useful convenience, so I fail to see why it
> belongs more in a plugin than in jQuery itself.  :-)
>
> Best regards,
> Jeremy Morton (Jez)
>
> On Dec 13, 12:09 pm, Choan Gálvez <[email protected]> wrote:
>> Hi.
>>
>> On Dec 13, 2008, at 10:31 AM, jez9999 wrote:
>>
>>
>>
>>> Yeah, but couldn't it just go in jQuery main?  It's fundamental  
>>> enough
>>> that it'd be nice just to have it there.
>>
>> It may be fundamental to you. I've never needed this feature.
>>
>> A plugin it's the place.
>>
>> Best.
>> --  
>> Choan
>>
>>
>>
>>> Best regards,
>>> Jeremy Morton (Jez)
>>
>>> On Dec 12, 5:06 pm, "Kelvin Luck" <[email protected]> wrote:
>>>> Hi,
>>
>>>> You could write a _very_ simple plugin to do this if you wanted:
>>
>>>> $.fn.delCss = function(p)
>>>> {
>>>>         $(this).css(p, '');
>>
>>>> }
>>
>>>> Hope that helps,
>>
>>>> Kelvin :)
>>
>>>> On Fri, 12 Dec 2008 08:42:40 -0800, jez9999 <[email protected]>
>>>> wrote:
>>
>>>>> Hello,
>>
>>>>> I'd like to see the following in the next version of jQuery: a
>>>>> function named something like .delCss(name), which would actually
>>>>> delete/unset the style property of the given name on all matched
>>>>> elements.
>>
>>>>> See, you can already do this by setting the desired style
>>>>> properties/
>>>>> values in a particular class and then  
>>>>> using .removeClass(classname),
>>>>> so it seems to me to be logical that you should be able to do it
>>>>> with
>>>>> CSS style properties too.
>>
>>>>> I know common things to do are to set properties to the empty
>>>>> string,
>>>>> or 'default', or something instead, but logically to me it feels
>>>>> nicer
>>>>> to be able to 'unset' the property, even if what jQuery is doing
>>>>> behind the scenes is just setting the property to the empty  
>>>>> string.
>>>>> Perhaps in future browsers will offer a genuine way to unset
>>>>> properties in Javascript using an actual Javascrupt 'unset'
>>>>> function,
>>>>> which could then be implemented in jQuery's .delCss() function.
>>
>>>>> An example of how this would work would be, say, I set a  
>>>>> particular
>>>>> background-color on an element (either using style="" in the
>>>>> markup or
>>>>> via Javascript, which I understand is identical in terms of
>>>>> specificity).  I could then later call $
>>>>> ('#myElem').delCss('background-
>>>>> color') on it, which in this property's case would cause the  
>>>>> browser
>>>>> to revert it to the default when the property is unspecified -
>>>>> 'transparent' 
>>>>> (seehttp://www.eskimo.com/~bloo/indexdot/css/properties/colorbg/bgcolor.htm)
>>>>> .
>>>>> This feels nicer to me than $('#myElem').css('background-color',
>>>>> '').
>>>>> Could we see this in future?  :-)
>>
>>>>> Best regards,
>>>>> Jeremy Morton (Jez)
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to