As you all know there is no replacement for ids. and 200 classes or ids is
ridiculous! but by using a single id for the div in question and letting the
styles cascade and letting jQuery do what, I feel, it does so well, you can
eliminate the use of 90% of ids.
Since most good xhtml (and html) is hierarchical, css & jquery deal well
with that hierarchy! I love seeing code like
$("#sPictures img:visible").animate({opacity: 'hide',height: 'hide',left:
window.innerWidth-90,top:window.innerHeight-90
},slow,'',function(){$(this).attr('style','display:none')})
with 1 id on a div ,instead of searching or remembering for ids and which
was hidden!
jquery gives me that power!
On 1/19/07, Matt Stith <[EMAIL PROTECTED]> wrote:
Exactly. It is senseless to use 200 classes when you have a big list, just
make them unique IDs (item_100, item_156, etc) and speed up the queries a
little bit.
On 1/19/07, Su <[EMAIL PROTECTED]> wrote:
> Seriously. You've succeeded in making yourself misunderstood. Now what?
>
> You can't put ids and classes next to each other for comparison like
> this and then write one off. It doesn't work; they don't even do the same
> thing..
>
>
> On 1/19/07, Matt Stith < [EMAIL PROTECTED] > wrote:
> >
> > So.... clarify.. why are IDs so bad? Just because they are overused?
> >
> > On 1/19/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED] > wrote:
> > >
> > > Don't get me wrong, I use an occasional id. But ids are over used.
> > > Sure jQuery selects a single element faster with an id than with a
> > > class, but that's only the beginning of a good chain of jquery!
> > >
> > > With a properly formatted html/xml, you can deal with the ancestors,
> > > children, siblings, prev, next, and filter. That's why xml, xsl,
> > > xquery, xpath, and jQuery are cool technologies (in my mind) and
> > > text
> > > files and last millennium javascript programs are not.
> > >
> > >
> > > The reason I'm posting this is I made a reference to this motto,
> > > that
> > > might be misunderstood.
> > >
> > > "IDs are a crutch for the weak. Classes are for the strong."
> > >
> >
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/