jQuery
New Wave Javascript


discuss » Newbie trying


Posted: Sat Feb 4 19:54:14 EST 2006
From: John Resig <jeresig at gmail.com >

Dan,

At the top of your HTML file, you can add something like this:
<script>
$(document).ready(function(){
$("#myLink").toggle(function(){
$("#jQHide").hide("slow");
},function(){
$("#jQHide").show("slow");
});
});
</script>

This will attach a 'toggle' to a link which had an ID of 'myLink'.
Then, when you click the link, the Element with an ID if jQHide will
first be hidden, then be shown (the next time you click). It should
continue back and forth in this manner.

I whipped up a quick demo of this, in action - which can be found here:
http://jquery.com/test/toggle.html

I hope this helps!

--JOhn

On 2/4/06, Daniel Acuff <jojowebdev at gmail.com> wrote:
> Thank you! Where do I place the code? In the head section? In the body
> section?
> Call it from the hyperlink I have created close my panel.
>
> Can a line of code be combined so that one hyperlink will open AND close
> the same panel?
>
> DAN
>
>
> On 2/4/06, John Resig < jeresig at gmail.com> wrote:
> > Hi Daniel,
> >
> > To close a panel, using the info you've provided, would be like this:
> > $("#jQHide").hide();
> >
> > If you want to do it with a snazzy animation, try this:
> > $("#jQHide").hide("slow");
> > or:
> > $("#jQHide").hide("fast");
> >
> > I hope this helps!
> >
> > --John
> >
> > On 2/4/06, Daniel Acuff <jojowebdev at gmail.com> wrote:
> > > I am not really even a JavaScript programmer by trade, so trying to jump
> in
> > > and take advantafe of something like remote (or) dynamic scripting with
> > > jQuery is something of a stretch for me.
> > >
> > > I tried one use of jQuery with limited success on my part.
> > >
> > > Today I was trying something new. as shown on
> > >
> http://www.jojowebdesign.com/skills/javascript/javascript_content.asp
> > > It seems that by implementing your library functions I should be able to
> > > make the jQuery information panel open and close correct?
> > > I have named an id tag jQHide so that there is an element to command.
> But I
> > > am unsure how to begin learning to make it happen.
> > > I spent some time today going through the jQuery docs.
> > > http://jquery.com/docs/fx/
> > >
> > > Thanks
> > >
> > > --
> > > Dan Acuff
> > > Sr. Web Designer, Sr. Web Developer
> > > www.jojowebdesign.com
> > > jojowebdev at gmail.com
> > > _______________________________________________
> > > discuss mailing list
> > > discuss at jquery.com
> > > http://jquery.com/mailman/listinfo/discuss_jquery.com
> > >
> > >
> > >
> >
> >
> > --
> > John Resig
> > http://ejohn.org/
> > jeresig at gmail.com
> >
> > _______________________________________________
> > discuss mailing list
> > discuss at jquery.com
> > http://jquery.com/mailman/listinfo/discuss_jquery.com
> >
>
>
>
> --
> Dan Acuff
> Sr. Web Designer, Sr. Web Developer
> www.jojowebdesign.com
> 203.733.6336
> jojowebdev at gmail.com
> _______________________________________________
> discuss mailing list
> discuss at jquery.com
> http://jquery.com/mailman/listinfo/discuss_jquery.com
>
>
>


--
John Resig
http://ejohn.org/
jeresig at gmail.com