Posts Tagged ‘plugin’

jQuery Tag Cloud Plugin

May 27th, 2010

See Online Demo

This plugin will create a animated tag cloud out of the list of tags for your blog/site. It is based upon the jQuery framework. Although there are many tag cloud available in jQuery Plugin arsenal, I really felt the need to create this one. The plugin include font animation as well as tag animation in three ways (horizontal, vertical and random). The animation will stop when user mouse over on the tag cloud, restarts after sometime after mouse out. Very easy to implement and customize. You just need to write a simple line apply it on the <div> or <ul> containing list of tags.

See online demo | Download Tag Cloud Plugin

jQuery Tag Cloud Plugin

ScreenShot jQuery Tag Cloud Plugin

Usage

Step 1: Style tags container. The tags container can be div, ul or anything else. But you need to define these style properties for the tags container before using the plugin – Position, Width and Height. You can style <a> of the tags as you wish.

Step 2: Include latest jquery.js and jquery.tagcloud.min.js in <head> section of the page like following,

<script type=”text/javascript” src=”jquery.js”></script>
<script type=”text/javascript” src=”jquery.tagcloud.min.js”></script>

Step 3: Apply the tag cloud plugin on the tags container. like following

<script type=”text/javascript”>
$(function(){
$(“#tag-cloud”).tagCloud();
});
</script>

Instead of #tag-cloud, just give #<id of the tags container>

Customize

Direction: You can choose the direction of the tags movement. There are 3 options – “vertical” (see Example3), “horizontal” (see Example2) and “random” (see Example1). The default option is “random”. You can set it as following,

$(“#tag-cloud”).tagCloud({“direction”:”horizontal”});

See Example2 and Example3.

Easein: You can use various kinds of easing effects provided by the jquery easing plugin. The list of easing effects can be found at http://gsgd.co.uk/sandbox/jquery/easing/ . Please Note if you want to use this option, then first include the easing plugin before applying the plugin. See Example2 and Example3. You can set this option like,

<script type=”text/javascript” src=”http://gsgd.co.uk/sandbox/jquery/easing/jquery.easing.1.3.js”></script>
<script type=”text/javascript”>
$(function(){
$(“#tag-cloud1″).tagCloud({ “easein”:”easeOutBounce”});
});
</script>

Speed: You can set the speed of the tags animation in the plugin. You simply need to set the speed option parameter. It only accept numeric value like 2000 (2 seconds). Keep it more than 2000 for smooth animation. It can be set as,

$(“#tag-cloud”).tagCloud({“speed”:2000});

Combination: You can set all the options at once like

$(“#tag-cloud”).tagCloud({“direction”:”vertical”, “easein”:”easeOutBack”, “speed”:2000});

See online demo | Download Tag Cloud Plugin

As you see its pretty straight to apply it and its effects are amazing. You can have as many tag cloud on your blog/site as you wish. I tried to keep it very simple, but if you still have some doubts/difficulties in implementing it or need help, feel free to post your comments. If anyone want to extend this plugin here is its uncompressed version . Hope it will help in making your blog/site more dazzling !!!

A Fancy Image Gallery using jQuery

April 20th, 2010

CLICK HERE TO CHECK IT OUT !!!

Last week I thought of making a image gallery using jQuery (again not to mention I am one of jQuery’s fan). There were already so many nice image gallerias available online. People have almost used all the jQuery effects to create different gallerias. So, I was searching to create something unique as its no fun to create what is already made.

Image Gallery

ScreenShot of Image Gallery

 

Recently while browsering Cue Blocks Website (http://www.cueblocks.com/), I came across office gallery made in Flash which caught my eye. As it was built in Flash, the image were tilted at random angles, the images spreads on load, you can drag them anywhere inside gallery area and you can preview image by double clicking on it. Never seen such type of gallery built through jQuery. I imagined all these features can be implemented by jQuery (except for tilted images, for which there were no plugins available).

I found many of these effects can be implemented through jQuery UI or plugins. I built the logic in jQuery to spread the images randomly over gallery area. Used jQuery UI drag.js to make image thumbnail draggable. Easing plugin to give cool effects while spreading and showing preview. Then I thought of adding some auto animation in spreading images after some fixed interval of time. For which I used timer.js (jQuery plugin).

Result of all above is this image gallery. I am posting this on my blog so that you all can provide me your feedback and suggestions on it. I am planning to build a jQuery plugin for this, so all your ideas will be very helpful to me and hence welcomed.

Also, write to me if you want this gallery on your site.

JQuery Pagination Plugin

January 7th, 2010

Downloaded more than 2000 times.

After using various jQuery plugins for pagination, I decided to write my own jQuery paginator plugin. While creating this plugin, I tried to overcome other plugin’s limitations and make it easy & highly customizable to meet demands of most of developers. Here are few features of this plugin,

1)      Very simple. Just 1 line of code to apply pagination on any div/container.

2)      No need for creating extra divs for pagination.

3)      4 styles of pagination.

4)      Various other options like jump to page, page info and change items per page on fly.

5)      Easy customization and styling.

6)      Nice fading effect during changing of page.

Why use it? Often you have large number of items/data in a div, which not only breaks your design but also looks ugly and lengthy. Apply this plugin on that div and you will get a nice seamless pagination on that div, which don’t break your design and visitors can easily navigate to all the items. You can style or it customize according to your requirements.   See Demo.

Implementation:

1)      Download latest jquery script and paginator.js

2)      Include both scripts in html document in head section.

<script src="js/jquery.js"></script>
<script src="js/paginator.js"></script>

3)      Initiate pagination by  writing following code in head section inside <script> tags,

<script>
$(function(){ $("#<id_of_div>").pagination(); });
</script>

// instead of <id_of_div>, type in id of the div on which you want to create pagination.

Its all you need to do. Load the page on browser and now you can see a simple, basic pagination on the page. See Demo.

Customization:

1)      Style Paginator: There are 3 classes – paginator (container for paginator), active (class for active pages) and inactive (class for current page). We can apply little css on these classes to make paginator looks pretty, either in document itself or in stylesheet. See demo

<style type="text/css">
.active
{
color:#0033CC;
border: solid 1px #0000FF;
padding:3px 5px;
margin:5px;
text-decoration:none;
}
.inactive
{
color:#000000;
cursor:default;
text-decoration:none;
border: solid 1px #0000FF;
background-color:#0099FF;
padding:3px 5px;
margin:5px;
}
</style>

2)      Paginator Style: Open paginator.js, there is a variable called paginatorStyle. This variable accepts values from 1 to 4, for displaying different styles of paginator.  More info is given in comments below that.

3)      Pagination Position: By default the position of paginator is below the div where pagination is applied. In paginator.js you can change paginatorPosition to ‘top’ if you want paginator to be on the top instead of bottom, or ‘both’ if you want it to be on both (top and bottom).

4)      Changing Symbols: Open paginator.js, there are variables like firstPageSymbol, previousPageSymbol, nextPageSymbol, lastPageSymbol. You can change these symbols, so instead of << as symbol for first page, you can write FIRST PAGE, or give img tag if you want fancy image for first page. Also, there is a variable called separator, which will appear in-between page options. Make it blank if you don’t want it.

5)      Changing Items per page and Start Page: By default there are 5 items per page and start page for pagination is first page. You can change them in paginator.js, the variables are named itemsPerPage and startPage.

6)      Enabling other options: There are 3 options available, like goto to page, change items per page, display page info. By default these are disabled, you can enable them according to your needs. You can enable them by replacing false with true as variables value, in paginator.js. More info is given in comments besides each option.

7)      Calling pagination again after changing content: If you change content, upon which pagination is applied in-between, just call initPaginator(); after changing content. It will apply pagination again on the new content with same previous settings.

8)      De-paginating Content : At any time, if you want to remove pagination from the content, just call $("#<id_of_div>").depagination(); You can call $("#<id_of_div>").pagination(); to apply pagination again on same or any other content. Kindly remember, at one time you can apply pagination on only one div or content. If you want to apply pagination on other div during program, first call depagination function on previous div and then pagination function on new div.

9)      Don’t want to open paginator.js: No worries, if you don’t want to change these variables in paginator.js, you can still change these variables in html documents just before calling the pagination function. Like See Demo.

$(function(){
itemsPerPage = 3;
paginatorStyle = 2;
paginatorPosition = 'both';
enableGoToPage = true;
$("#result").pagination();
});

That’s it. Apply it wherever you want. Play around it with, try different styles and options. Email me in case of any bug, error, confusion or you need any further assistance/customization. All kinds of feedbacks are appreciated and welcomed.

I also recently uploaded uncompressed version of the plugin for development purposes, download it. feel free to download and extend it. Also, I have uploaded this plugin on jquery plugin directory. Here is the link – http://plugins.jquery.com/project/jquery-pagination

Tested in all major Browsers

Tested in all major Browsers