$(document).ready is the original and is what happens behind the scenes ... the shortcut is because we don't like typing. :)
--
Brandon Aaron
<div><span class="gmail_quote">On 6/14/07, <b class="gmail_sendername">
Charlie Concepcion</b> <<a href="mailto:charlieconcepcion@gmail.com">
charlieconcepcion@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks Rafael... Thanks Everyone!
It works great, man I'm loving this simple jQuery syntax.
One more question though... why use the shorcut version vs.
document.ready?
I mean if this is the case why'd they even make
document.ready?
On Jun 14, 5:10 pm, "Rafael Santos" <<a href="mailto:shanex.f...@gmail.com">
shanex.f...@gmail.com</a>> wrote:
> $(function(){ //shortcut for $(document).ready(){fn}
> $("#nav > li").hover(function(){
> $(this).addClass("over");
> }),function(){
> $(this).removeClass("over");
> })
>
> });
>
> 2007/6/14, Charlie Concepcion <<a href="mailto:charlieconcepc...@gmail.com">
charlieconcepc...@gmail.com</a>>:
>
>
>
>
>
> > Ok I am new to this so here's my old code:
>
> > $(document).ready(function(){
> > $("#nav > li").mouseover(function(){
> > $(this).addClass("over");})
> > .mouseout(function(){
> > $(this).removeClass("over");});
> > });
>
> > I need that in hover version. I'm assuming it's supposed to be much
> > shorter.
>
> > On Jun 14, 4:57 pm, "Rafael Santos" <<a href="mailto:shanex.f...@gmail.com">
shanex.f...@gmail.com</a>> wrote:
> > > I think u can use both, hover and mouseover. jQuery uses javascript to
> > treat
> > > it.
>
> > > 2007/6/14, Charlie Concepcion <<a href="mailto:charlieconcepc...@gmail.com">
charlieconcepc...@gmail.com</a>>:
>
> > > > I'm new to jQuery and I have to say I love it! I hate javascript but
> > > > now I like it cuz of query. Anyways enough of that :)
>
> > > > I'm a CSS developer also. I know that the :hover pseudo element
> > > > doesn't work in IE 6 so I always have to use javascript using
> > > > mouseover/mouseout events.
>
> > > > My question is, in jQuery is hover using the CSS or using acting as a
> > > > backend mouseover event?
>
> > > > Final question... what should i use hover or mouseover... making sure
> > > > it works on IE7, Firefox and IE6.
>
> > > > Thanks!
>
> > > --
> > > Rafael Santos Sá :: <a href="http://webdeveloperwww.rafael-santos.com">webdeveloperwww.rafael-santos.com
</a>
>
> --
> Rafael Santos Sá :: <a href="http://webdeveloperwww.rafael-santos.com">webdeveloperwww.rafael-santos.com</a>
</blockquote></div>