Contact Us

Call Us
01172307555
07738291791
Email Us
info@cwpstudios.com
Message Us
Twitter: @cwpstudios

About Us

cwpStudios.com is a web devolopment studio based in Bristol, UK

Articles

8th September 2011 at 6:56

Using JavaScript libraries to create interactive websites

Why should I use JavaScript Libraries?
When creating complex interactive websites JavaScript is great but it can take a long time to code even the simplest of tasks. Just fading out an element in JavaScript takes many lines of code.

This is why javascript librarys are so popular. They can simplify your JavaScript code helping you create better websites faster. There are a bunch of different JavaScript librarys out there including, MooTools, jQuery and ProtoType. By far the most popular is jQuery so we will focus on that for this article.

How do they work?
A library is just pre-written code that contains the logic to do certain tasks. Librarys can be very helpful when you need to perform common tasks that are tedious to code yourself. Instead of spending hours writting code from scratch you can simply import a library into your code and use it's logic.

How can jQuery help you
Hiding a element is pretty easy in Javascript you just need to get the element you want to hide then set it's properties. For example:

document.getElementById("myElement").style.visibility = "hidden";

But in jQuery it's even easier and if you're going to be hiding and displaying elements a lot it can save a lot of time. Consider the follow:
$("#myElement").hide();

jQuery makes use of CSS notation so you can get elements by specifying their ID or class with a '#' or a '.' as you would in CSS.

So what if you that div to fade out slowly instead of just disappear? That's simple in jQuery! You just call the fadeOut() function instead.
$("#myElement").fadeOut();

That's it! You can even specify a fade out duration in milliseconds as a parameter...
$("#myElement").fadeOut(200);


Is there any other benefits?
jQuery is a brilliant tool if you're interested in creating dynamic websites. It's very easy to implement AJAX and other modern web development concepts.

You can also be confident that code will support all the important browsers and be bug free.

News


Getting The Best Deal
Ask us for a quote before you buy, it's free!

Need Help With JQuery?
We at cwpStudios.com can help you with all your JQuery problems, just get in touch!

New Site Launch
Welcome to the new home of cwpStudios.com

About Us

We're passionate about helping new and established businesses reach the next level of success through their internet presence.

Our experts can guarantee your business has the online visibility it needs with an all encompassing package of branding, web development and digital marketing.

We will take care in understanding your business and help you develop effective digital marketing strategies for your individual business to help it grow to its full online potential.

Lets get started...