jQuery
New Wave Javascript


discuss » Newbie trying


Posted: Sun Feb 5 03:11:20 EST 2006
From: John Resig <jeresig at gmail.com >

If clicking the link is causing the page to reload, then the
Javascript isn't loading properly and an error is occuring. Do you
have a link to the file that you're testing with? I'd like to take a
look at it, if I can.

--John

On 2/5/06, Daniel Acuff <jojowebdev at gmail.com> wrote:
> Hmm.. Nothing for me. I removed that anchor pop-up code from earlier.
>
> I am concerned the empty href="" is causing the page to just reload...
>
> Any other ideas? I will try it in IE thoy
>
>
> DAN
>
>
> On 2/4/06, John Resig <jeresig at gmail.com> wrote:
> > Dan,
> >
> > I tweaked the demo page to be more like yours - and tested it in
> > Firefox and IE and it still works. The only 'weird' thing is that
> > since an alert is popping up everytime you click the jQLink, you no
> > longer get the smooth animation. Removing the $("a")... bit makes it
> > work just fine.
> >
> > --John
> >
> > On 2/4/06, Daniel Acuff <jojowebdev at gmail.com> wrote:
> > > Hmm I try not to confess it much but, leave it to me for it to not
> work..
> > > hehe.
> > > The only difference is that I initially chose mine to be a <p>aragraph
> > > section instead of a <div> cause I wanted my paragraph spacing. What did
> I
> > > miss?
> > >
> > > Thanks,
> > > DAN
> > >
> > > <script type="text/javascript">
> > > $(document).ready(function(){
> > > $("#jQLink").toggle(function(){
> > > $("#jQHide").slideUp("slow");
> > > },function(){
> > > $("#jQHide").slideDown("slow");
> > > });
> > > $("a").click(function(){
> > > alert("Thanks for coming");
> > > });
> > > });
> > > </script>
> > >
> > > <a href="" id="jQLink">open / close</a>
> > >
> > > <p id="jQHide">
> > >
> > > I would not believe it if only div's are 'hideable'.
> > >
> > >
> > > On 2/4/06, John Resig <jeresig at gmail.com> wrote:
> > > > 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
> > > >
> > > > _______________________________________________
> > > > 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
> >
> > _______________________________________________
> > 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
> _______________________________________________
> jQuery mailing list
> discuss at jquery.com
> http://jquery.com/discuss/
>
>
>


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