5 Excellent JQuery Navigation Examples

May 11th, 2009 by liangshing

Stumble across some JQuery examples on Digg while having my breakfast. Hhaa.. Enjoy~

1. JGlide Menu
http://images.sixrevisions.com/2009/04/29-18_jglide.jpg

View Demo

2. JQuery UI Tab

http://images.sixrevisions.com/2009/04/29-16_jquery_ui_tabs.jpg

View Demo

3. Sliding Boxes and Captions


http://buildinternet.com/wp-content/uploads/slidingbig.jpg

View Demo

4. Animated Menu Using JQuery


http://images.sixrevisions.com/2009/04/29-07_animated_menu.jpg

View Demo

5. Using JQuery For Background Image Animation


http://images.sixrevisions.com/2009/04/29-12_background_position.jpg

View Demo

Adding Google Search Bar

March 24th, 2009 by liangshing

HOorrray! This is my first blog since the day i know how to write! Haha. Hmm.. For those who actually bother to read my post, pardon me for all all my wonderful grammars mistake and spelling errors. =D

Anyway, I would like to share with you, this cool piece of technology from our dear friend Mr Google! It’s call “The Google AJAX Search“. It’s a Javascript library that allows you to embed this search engine into your web pages and also other web applications. Neat right!? =D

A simple example of how to implement it. Of course you’ll need to register for the google API key first. =D

Includes these files at your header.

<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=<?=GOOGLE_API_KEY?>" type="text/javascript"></script>
<link href="http://www.google.com/uds/css/gsearch.css" rel="stylesheet" type="text/css"/>

Remember to replace the “<?GOOGLE_API_KEY?> to your registered key

Next put these codes in :

function LoadNewsBar(keyword)
{
      // create a search control
      var searchControl = new google.search.SearchControl();

      // Set the Search Control to get the most number of results
      searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);

      // Create 2 searchers and add them to the control
      searchControl.addSearcher(new google.search.WebSearch());

      // Set the options to draw the control in tabbed mode
      var drawOptions = new google.search.DrawOptions();
      drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);

      // Draw the control onto the page
      searchControl.draw(document.getElementById("newsBar"), drawOptions);

      // Search!
      searchControl.execute(keyword);
}

The “keyword” variable used inside the code is the word that you’re going to search for. So to get it up working fast, you might want to hardcode to some keywords in mind?

Example :

var keyword = 'google';

Congrats! You’ve successfully implement Google Ajax Search into your web. For more details on the API, click HERE. You may want to check out their cool ‘playground’ and toy around their API.

Google Ajax APIs Playground

For a working demo  click HERE.