You nailed it all, so people can only really say ditto. You obviusly know enough to make a good decision. Maybe thts why there aren't a lot of replies? I dunno.
I personally use data-locked once I learned about html 5's implementation of it. Unless something that's locked has a lot to do with how it looks relative to other locked, unlocked elements--then I use classes like aaron. Right now I've got a page that stores a pyramid of children and parents on each element (network marketing chart tool). Classes would be a mess, the logic is already done server side (otherwise I'd use el.store) so I drop it all in data-children and data-parents. Valid html 5 is good enough for me. On 7/15/09, Rolf <[email protected]> wrote: > > Hmm grmbl.. hoped on more responses and what others normally use :) > I guess I will stick to (css) classes now and move to data-* > attributes in a couple of months. > Using other custom attributes looks neat, but maybe just awkward, > since its not xml (and you kinda make it look like it with more custom > than standard attributes). > > > On Jul 14, 12:47 am, anutron <[email protected]> wrote: >> I use css classes. In my mind, saying that a div is of class "locked" >> makes >> sense to me. it's not <div css="locked"> it's class="locked" and the >> notion >> that I have numerous elements of that class makes sense to me, even if I >> don't style them. It makes it easy to style them later if I decide to, >> though. >> -aaron >> >> 2009/7/13 Fábio M. Costa (via Nabble) < >> [email protected]<ml-user%[email protected]> >> >> >> >> >> >> > on html5 there will be suport for custom attributes. >> > If the attribute starts with "data-" it will be valid. >> > Ex: >> >> > data-locked="true" >> >> > Its for sure what will be done for now on (if you want custom >> > attributes). >> >> > Fábio Miranda Costa >> > Solucione Sistemas >> > Front-End Engineer >> >http://meiocodigo.com >> >> > On Mon, Jul 13, 2009 at 6:32 PM, Rolf -nl >> > <plentyofr...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3253430&i=0> >> > > wrote: >> >> >> This has been talked about before here (search for "custom attributes" >> >> or "custom properties") but without some sort of conclusion. Could try >> >> and revive an old post, but ok... let's start a fresh one in 2009 ;). >> >> >> When working with javascript+moo you have the possibility to use store/ >> >> retrieve for custom data "attached" to an element. This works dead >> >> easy and is a no brainer basically. >> >> >> But what do you do when you have an html page (either created >> >> dynamically or not) and you apply javascript logic to various elements >> >> after the page is loaded (ondomready) in an unobtrusive way, and you >> >> need some "start up" data from the elements to use store to begin >> >> with. >> >> >> A simple case: a div element that is locked or not (the locked state >> >> is just an example, dunno what's it for ;)). >> >> >> So you could add a custom attribute: >> >> <div locked="true"></div> >> >> >> Or you could use a class: >> >> <div class="locked"></div> >> >> >> Or you could use rel (but hey, it's already in use for other stuff), >> >> let's just assume all valid attributes are already "filled". >> >> >> Solutions: >> >> - The custom attribute is not valid. You can enhance a standard DTD >> >> and create your own custom one. Ok, sounds tedious. >> >> - You could just use the custom attribute and forget about validation. >> >> - You could just use classes.. easy.. but hey, those are meant for css >> >> styling really, so could be confusing. >> >> >> What do you advise? I used css classes to "describe" this sort of >> >> stuff, but now I think about just adding some custom attributes to set >> >> "start up data", as it creates better looking html, and I can add more >> >> detailed "start up data" (e.g. the desired fx transition and length >> >> for each element).. and just forget about w3c. >> >> >> Any input? >> >> > ------------------------------ >> > View message @ >> >http://n2.nabble.com/-Moo--custom-attributes%2C-%28css%29-classes..-w... >> > To start a new topic under MooTools Users, email >> > [email protected]<ml-node%[email protected]> >> > To unsubscribe from MooTools Users, click here< (link removed) >. >> >> ----- >> The MooTools Tutorial: http://www.mootorial.comwww.mootorial.com >> Clientcide: http://www.clientcide.comwww.clientcide.com >> -- >> View this message in >> context:http://n2.nabble.com/-Moo--custom-attributes%2C-%28css%29-classes..-w... >> Sent from the MooTools Users mailing list archive at Nabble.com. -- Sent from Gmail for mobile | mobile.google.com
