HTML/CSS Service

Why we use jQuery?

Category: Learn jQuery    |    1,023 views    |    1 Comment  |   

jQuery is ideal because it can create impressive animations and interactions. jQuery is simple to understand and easy to use, which means the learning curve is small, while the possibilities are (almost) infinite.

Javascript and Best Practices

Javascript has long been the subject of many heated debates about whether it is possible to use it while still adhering to best practices regarding accessibility and standards compliance.

The answer to this question is still unresolved, however, the emergence of Javascript frameworks like jQuery has provided the necessary tools to create beautiful websites without having to worry (as much) about accessibility issues.

Obviously there are cases where a Javascript solution is not the best option. The rule of thumb here is: use DOM scripting to enhance functionality, not create it.

Unobtrusive DOM Scripting

While the term “DOM scripting” really just refers to the use of scripts (in this case, Javascripts) to access the Document Object Model, it has widely become accepted as a way of describing what should really be called “unobtrusive DOM scripting”—basically, the art of adding Javascript to your page in such a way that if there were NO Javascript, the page would still work (or at least degrade gracefully). In the website world, our DOM scripting is done using Javascript. Read more…

Share/Save/Bookmark

 

Adding and Removing a CSS Class with jQuery

Category: Learn jQuery    |    2,486 views    |    1 Comment  |   

irst, add some style information into the <head> of your document, like this:

 <style type="text/css">
    a.test { font-weight: bold; }
 </style>

Next, add the addClass call to your script:

  $("a").addClass("test");

All your a elements will now be bold.

To remove the class, use removeClass

 $("a").removeClass("test");
  • (CSS allows multiple classes to be added to an element.)
[edit]

Special Effects

In jQuery, a couple of handy effects are provided, to really make your web site stand out. To put this to the test, change the click that you added earlier to this:

 $("a").click(function(event){
   event.preventDefault();
   $(this).hide("slow");
 });

Now, if you click any link, it should make itself slowly disappear.

Share/Save/Bookmark

 

how to Create a fancy image gallery with JQuery

Category: CSS Examples    |    461 views    |    Add a Comment  |   

Why jQuery?

jQuery is ideal because it can create impressive animations and interactions. jQuery is simple to

understand and easy to use, which means the learning curve is small, while the possibilities are (almost) infinite.

Demos:

  1. Simple tooltip
  2. Image tooltip with preview
  3. Link tooltip with preview

Installation

Step 1

First, you have to include the JQuery library between the <head> and </head> tags of your html page:

<script type="text/javascript" src="jquery-latest.pack.js"></script> Read more...

Share/Save/Bookmark