How To jQuery Toggle

jQuery was made to change the way that you write JavaScript. jQuery has tons of really nice effects that you can experiment with. One of my favorite things to do with jQuery is to do a toggle this is a really simple effect to do but will make people go WOW when they see it. You can use the toggle effect in multiple different way most of the time people just use the toggle up to down or toggle left to right. But some people don’t know that you can use jQuery toggle to go from your upper left or right corner to the opposite corner. Well here is some code that you can reference on different ways to toggle.

Lets do the easy toggles first

Top To Bottom

I am doing this for the comments section of most WordPress sites. First you have to give the identify what the outer most container is of your comments section. Mine is id comments. So just to the top of my comments section I need to create a button but you don’t have to use a button it is just the easiest to explain. So you should have something that looks like this.

You will notice that I gave the button a id that is so that jQuery can find it. Next you have to create your js file. I would name it something like toggle.js. It should look like this depending on which way you want your content to toggle.

Now all you have to do is call your jQuery script and a jQuery library and your toggle up to down should work. I use the Google library because of how quick it is. You can find more info about the Google library here jQuery Library

Other Ways To Toggle

There are a few other ways to do a toggle like from bottom to top and bottom corners to top corners. There is also some other things that you can do with toggle like fading. jQuery has a lot of really easy and light things that you can do to your site to make it just that much better. If I were you I would take a look at their site jQuery.

In case you're interested in knowing more info on park place residences, stop by https://www.parkplacesresidences.com.sg It is so pleasant to work with experts. Read more to find out more regarding binary options copy trading. Are you looking for "buy mini truck"? Check out substarinc The passionate experts in this field are ready to answer all of your requests.

About Shane

Hi I am Shane the main author of this blog. I am a self taught web developer. I have been working in this industry since 2008. I work a lot with WordPress, Magento, SEO & SEM, and custom built websites. I love all sports and I will try anything at least twice.

Working remotely is one of the fastest growing perks in the working world. It’s something that people talk about a lot, and it’s a solution to the “work/life balance” problem that bothers so many people. Most of us have asked the question, “Why do I work so hard?” For some people, there are many sides

Know little about the use of keylogger for Android? Wondering why so many friends choose free Android spy? What benefits can you get from tracking cell phones of your children and employees with the help of sms tracker? Keep reading and find the answers in this short article. Have you ever dreamed of taking control

As a photographer whether it be a hobby or on a professional level the realm of high dynamic range photography can be very troublesome without photo editing software specifically made for photo HDR. Aurora HDR photography can be very challenging as it is, but with Aurora the job gets a little bit easier. Some might

  • I’d like to know how you did the “Leave A Response” toggle on this page… 🙂

    • The “leave a response” it is using jQuery toggle:

      $("#response").hide();
      $("#response_button").click(function() {
      $("#comments").hide();
      $("#response").animate({height: "toggle", width: "toggle"}, 1000);
      });

      In order to get it to close right you have to float the outer container to the right. You can do the same with left, that is how the Comments area is done. If there is something that you would like to learn with jQuery I can do a post about it.