Articles

jQuery Plugin - Feature List

1 Sep 2009 / 372 comments

I love the simplicity of using (and more important re-using) jQuery plugins. So I decided to release a plugin that came from my personal need - Feature List. This jQuery plugin enables simple and easy creation of an interactive "Featured Items" widget.

You can see the demo at this page, and you can download the complete source code with examples from here.

What’s So Great About this Plugin?

  • Slick effect, no Flash needed
  • It’s just 2K
  • Reusable on multiple containers
  • Cycles items via slideshow
  • Can be styled with custom HTML/CSS

How to Use

Using Feature List requires a simple function call:

01.
02.
03.
04.
05.
06.
07.
08.
09.
10.
11.
12.
13.
$.featureList(
	$("#tabs li a"),
	$("#output li"), {
		start_item : 1
	}
);
 
// Alternative
 
$('#tabs li a').featureList({
	output		: '#output li',
	start_item	: 1
});

This plugin is managed to implement quite quickly. The script requires two arrays of items - for tabs and output. When user clicks on one of tab the script finds corresponding output item by index and starts fading. A CSS class current is added to the current active tab.

Options

The following options are configurable:

  • start_item - Index of active tab by default (counting starts from 0) (default 0)
  • pause_on_hover - If true, animations will pause when the mouse hovers over the tabs (default true)
  • transition_interval - Length of time between transitions (0 = no automatic transitions) (default 5000)

Enjoy!

User Comments

  1. rzepak September 1st

    awesome! thanks!

  2. wadziu September 2nd

    nice nice, I'm ready to use :)

  3. paramah September 2nd

    gr8 hack ;)

  4. gsempe September 4th

    Nice!

  5. Morteza September 15th

    Thank you for this awesome work.

  6. Comments September 21st

    Awesome plugin!! great job. Tested it and I'm really digging it. can't wait to use it on my live site!! superb work!

  7. Keleo October 13th

    Looks great with Javascript! Do you plan on making it more unobtrusive? Probably its just the CSS that needs to be improved, I didn't have a deep look yet... I would love to see the improvement that links will still be visible with deactivated javascript :D Thanks for releasing your jQuery Plugin!

  8. oumar October 13th

    Great plugin, very promising ! And if it was sliding like in ModX website (modxcms.com

  9. Matt October 14th

    Can we add links to the large image once clicked on by the tab?

  10. jQueryGlobe October 16th

    @Keleo: I usually don`t care about users who have switched JS off. I guess you could change CSS and apply style with JS as needed. Maybe I`ll give a try. @Matt: I guess you can.

  11. ari October 17th

    Nice Thx :)

  12. Keleo October 20th

    Looks awesome now! I'll take it ;D

  13. Web Design India November 4th

    Not working properly in Firefox 3.5

  14. bali website design November 16th

    Creative! going to test it for my next project

  15. ASD November 21st

    ASDAS

  16. Ali November 30th

    This slider is awesome! I have one concern though... when viewed in IE the "see project details" box is lost. Any suggestions??? -Thanks

  17. olawale December 1st

    This is Great, but I have one question. How do you configure the transition interval? I'm trying to achieve longer durations for each picture. Thanks

  18. Olawale December 1st

    I think I've got it now. The options are evident in the actual script. Thx

  19. Nate Volk December 7th

    any chance there is a scrollable element around? I have a list of ten items, but only room for three at a time. Is there a way to make it scroll through them with the slideshow? Great plugin!!!

  20. security December 7th

    thanks good Feature List

  21. Duane December 11th

    Great job! I love how smooth the images transition. I have been experimenting with moving the tabs to the right side but can't figure out the css. I have created a mirror image of the tab background images. Can you explain the change to the code to get the tabs on the right?

  22. ron December 11th

    I think this would make a wonderful plugin for wordpress, hmmm

  23. Leonardo Borges December 11th

    Hey thanks for the nice script! One thing though, setting the interval to 0 (to stop transitions) does not work in chrome. A quick and dirty fix for the script is: options.transition_interval = options.transition_interval == null ? 5000 : options.transition_interval; Just wanted to let you know ;)

  24. smtjv December 12th

    Super plugin merci a toi

  25. punk December 14th

    awsum!!!!!!! was just looking for something similar for quite some time now. thanks :)

  26. Behind The WebDesign December 15th

    Nice component !

  27. keisuke December 17th

    Great work!

  28. SMiGL December 17th

    perfectly. thanks!

  29. David December 17th

    Thanks for sharing this! Love it...

  30. Marcell Purham December 20th

    Great plug-in! Cant wait to use it

  31. nas December 21st

    hello ... and sorry for my english... Great script ! is it possible to go to the next slide by clicking on a link ? and how to ? thanks !

  32. Kubuntero December 23rd

    Don't have any .zip, or any archive with all ?? thanks

  33. Wesam Alalem December 23rd

    thanks for the plugin, impressive work ;)

  34. dungeon December 23rd

    nice hack....

  35. gene December 24th

    nice

  36. zeejah December 24th

    very nice.

  37. Taimur Aziz December 27th

    Simply Awesome .. I will use it in my upcoming website.

  38. ửeử December 28th

    sfds

  39. Yemek Tarifleri December 28th

    thanks for sharing!

  40. thom December 28th

    very nice dude! U can publish a whole webpage in these list. It looks very good and its edit easier as easy! I think, more of plugins doesnt needed. Greez from Germany

  41. IT Freak December 28th

    I just loved this one.

  42. ArthasMX December 29th

    Awesome!

  43. richard armstrong December 30th

    would like to ask how to add further images and links? i can copy the code in the html file i know this, but do i have to make changes to the css file to?

  44. gourav December 30th

    great work

  45. Clément January 1st

    Thank you it's great

  46. arlicle January 2nd

    Cool! very cool

  47. abracren January 2nd

    nice! some issues (black images when it fades) with explorer 8 and my own images with tables. solved changing animation effect: output.stop(true, true).filter(\":visible\").hide(); output.filter(\":eq(\" + nr + \")\").slideDown(function() { visible_item = nr; thanks!

  48. Jake January 4th

    Very Nice. I will be using this for sure

  49. prashant January 6th

    Really awesome and simple plugin.. Thanks for sharing. I will surely implement on my next project

  50. David Pratt January 8th

    Very slick indeed.

  51. pman January 8th

    how do you stop the rotation once the tab is clicked?

  52. Boyd Dames January 9th

    Really awesome!

  53. jQuery Eklenti Arşivi January 10th

    Woow. Wonderful. Congratulations..

  54. Cash Advance January 12th

    That's what I'm loocking for. Thanks man for this plugin!

  55. Trần Ngọc Hiếu January 14th

    very nice , i love javascript forever

  56. Nice work. Thanks

  57. Max January 15th

    How do I delete the space above the margin? I tried the css but I could not

  58. Jonathan Miller January 16th

    This is a great plugin, and it is working really well with a project gallery I am working on. One thing I noticed though is a warning that the Javascript is spitting out. "Warning: Unknown pseudo-class or pseudo-element 'eq'." I'm not knowledgeable enough in js to understand what is going on here. Any chance you could explain, or perhaps even supress this warning? One more thing, is there a way to trigger the next tab item with a link buried somewhere else on the page (ie, not the predesignated tables)?

  59. Ahmet January 16th

    Great plugin for mainpage, thanks :)

  60. web dizajn January 16th

    Very nice, thanks.

  61. Ras January 17th

    Aynısı zaykon.blogspot.com da var

  62. Jeff January 19th

    I love this. Thanks for releasing it. Is there a way to display list items within one of the output tabs? I tried, and the script automatically throws a display: none; on them.

  63. Cool I like It February 4th

    Cool Java Script for Website.....:) Really Cool.....:)

  64. Tony February 5th

    This is working nicely except for one problem: transition_interval : 0 isn't disabling the automatic transitions...Any idea why? $.featureList( $("#homenavlist li a"), $("#output li"), { start_item : 0, transition_interval : 0 } ); });

  65. BKS February 6th

    When I validate the demo page at W3C I see a lot off errors. On my testsite I managed to fix all these errors except 3 of them and I cannot fix it myself. It's about this piece of code: Services Programming Applications Error message at W3C document type does not allow element "h3" here; missing one of "object", "ins", "del", "map", "button" start-tag Do you have a solution for this?

  66. digi neiker February 8th

    Tnx, nice share :)

  67. nerkn February 24th

    thank you both for writing also for publishing

  68. Mark Pedersen February 25th

    Hi, I love your work with this plugin. I'm wondering though, I followed through a blog which had this categorised under MIT License, but I see no mention of any kind in the source code or on your website, so I would like to know what restrictions apply. Best Regards, Mark.

  69. Mark Pedersen February 25th

    Sorry for that, I found it 5 seconds after posting.

  70. Jakcson February 28th

    awesome!!!

  71. Will February 28th

    Question. feature png does not display. I tried ./images/, ../../images/, /images/. When the is current the other css classes display the element correctly except for this one. FireFox 3.6. Thanks

  72. Will February 28th

    ...just to clarify. It's not your code because the demo works flawlessly. It's obviously my markup somewhere. I'll keep digging. disregard. Great plugin!

  73. Shinnobi March 3rd

    Thanks

  74. Friss Hírek March 4th

    Very nice plugin. Very small and very fast (for load). Thanks for sharing with us.

  75. I've to use translator to read this post and found very helpful to me. Thanks for sharing this great post.

  76. Frank March 10th

    In IE7, I notice the "project details" part overlaps for a short period from one tab to the next. It's smoother elsewhere - how do I fix this? Should it hide the details until the rest of the tab is loaded first?

  77. michaelmesh March 12th

    SWEET Plugin! Nice job.

  78. Adam March 17th

    Having the H3 tags inside the anchor tags means this Feature List does not validate for W3C standards. Anyone else had same problem and got a work around which still functions the same??

  79. Justin March 19th

    Hi, how would I go about changing the code so it doesn't cycle but only changes on click.

  80. Jezz March 19th

    @Tony I have the same issue, if you search for: options.transition_interval = options.transition_interval || 5000; In the javascript file and change the 5000 to 0 It will no longer auto transition.

  81. Jezz March 19th

    @Tony - scratch that, you just need to put the interval value in quites, e.g. '0'

  82. Jezz March 19th

    @Tony, sorry, meant quotes. $(document).ready(function() { $('#tabs li a').featureList({ output : '#output li', transition_interval : '0', start_item : 1 }); });

  83. Jezz March 19th

    @Justin - see my previous comments

  84. Seth April 2nd

    Shouldn't the a element returning false be built into the plugin? Makes for cleaner markup than having to do

  85. Seth April 2nd

    Code got cutoff -

  86. John Parrish April 5th

    If you had more then 3 item in a list is there a way you hide the extra ones and either us the scroll on the mouse or when you click on the top one the next one from the bottom scrolls up and vice-versa (click on the bottom one and one from the top scrolls in)

  87. izle April 8th

    Good job! Thank you!

  88. Wise Law April 9th

    Great Plugin. I needed one with the menu so this is awesome. Two questions maybe someone could help me with. How do I stop the slider after it has went through all of the "slides" once? And also, Is there a way to have it do this: If I hover over a menu item, show the image that is correlated with it? Thanks for any help

  89. evve April 26th

    Thanks so much.. I have one question: how to fade it slowly?

  90. heling April 28th

    Thank you for sharing this.Quite Creatively.

  91. Cheap tickets May 3rd

    Convincing way of expression due to that reason ur post become so informative. Thanx 4 that post and info. Open it.. www.cheapflightsservice.com Cheap Tickets.

  92. The-Marshal May 8th

    can i download the source code of this plugin .. because if i want to try this i must connect to the internet THANK VERY MUCH ABOUT THIS GREAT PLUGIN

  93. shuffle May 11th

    How can I set the time of the first loading pic? I only can change the transition_interval, but this is the interval during the other images. I just wanna change the duration of the first loading image. thanks

  94. this cloud May 12th

    thanks for sharing this pugin, it very useful, thanks again

  95. This is Great, but I have one question. How do you configure the transition interval? I'm trying to achieve longer durations for each picture. Thanks

  96. Sabrina May 15th

    Thanks for sharing this! Really helpful :)

  97. Niko June 4th

    Hi everyone.I am trying to use this motools script with jquery demos.mootools.net trying to use both script in same index.html But it's not working when i erase motools.js this jquery work.when i add motools.js accordion script work jquery tab selection notworking.I need help please.i am missing one little think but i dont know what.

  98. Leather Bed June 9th

    I tried swapping that out in the featurelist js file, but did not get the results I wanted. The script requires two arrays of items - for tabs and output. When user clicks on one of tab the script finds corresponding output item by index and starts fading. This is what make things go in good manner..

  99. ray June 10th

    I keep getting "The plugin does not have a valid header." when I try to activate it and it doesn't show up in my plugins listing.

  100. Naples hosting June 11th

    Fantastic plugin, thanks for sharing it!

  101. Mattress June 11th

    CSS can be workable!! It replace most of things..!!

  102. kelowna bc June 11th

    thanks, I'm very glad I could get more knowledge from here, articles and info-good info, made me grow even more success always to you ..

  103. Preben June 12th

    I replaced all the $ ´s with jQuery and the code doesnt work.. Is there anything i need to change? pastebin.com

  104. Preben June 12th

    Update to my post above: jQuery(document).ready(function () {jQuery.fn.featureList = function (options) {var tabs = jQuery(this);var output = jQuery(options.output);new (jQuery.featureList)(tabs, output, options);return this;};jQuery.featureList = function (tabs, output, options) { function slide(nr) {if (typeof nr == "undefined") {nr = visible_item + 1;nr = nr >= total_items ? 0 : nr;}tabs.removeClass("current").filter(":eq(" + nr + ")").addClass("current");output.stop(true, true).filter(":visible").fadeOut();output.filter(":eq(" + nr + ")").fadeIn(function () {visible_item = nr;});} var options = options || {};var total_items = tabs.length;var visible_item = options.start_item || 0;options.pause_on_hover = options.pause_on_hover || true;options.transition_interval = options.transition_interval || 5000;output.hide().eq(visible_item).show();tabs.eq(visible_item).addClass("current");tabs.click(function () {if (jQuery(this).hasClass("current")) {return false;}slide(tabs.index(this));});if (options.transition_interval > 0) {var timer = setInterval(function () {slide();}, options.transition_interval);if (options.pause_on_hover) {tabs.mouseenter(function () {clearInterval(timer);}).mouseleave(function () {clearInterval(timer);timer = setInterval(function () {slide();}, options.transition_interval);});}}};}) is not a function [Break on this error] })(jQuery); jquery....0.0.js (line 70) error in firebug.. anyone that can help?

  105. Mickey Ross June 16th

    Reusable on multiple containers?? How can I have two separate slide shows operating on the same page at the same time? At the moment it cycles through one and then the next.... thanks

  106. semio June 21st

    Hi, this plugin is awesome. Any chance to have it in a Wordpress Plugin ? Anyone knows ? thanks

  107. Andrei July 1st

    how it put pause on "output"?

  108. Pat July 1st

    Has anyone been able to integrate AJAX loading of the content pane? That would be awesome!

  109. Rahulchhabra July 3rd

    Thanks for sharing this! Really helpful :)

  110. Simon Norman July 7th

    Thanks for publishing - the effort's appreciated. I shared this with our developer for car leasing and he thought it was neat.

  111. car leasing July 7th

    this is really easy to use, thanks

  112. Raghib suleman July 8th

    Thanks for sharing this! Really Great Work :) www.raghibsuleman.com

  113. Ben July 9th

    This has worked like a charm, except for one thing - if I try to have an HTML list in the content (either UL or OL), the lists don't show up correctly. I think the "#output li" parameter interprets every "li" tag as a new output, or something - I'm a newbie with jquery. :) Does anyone have a solution to this problem? Thank you!

  114. James July 10th

    Is there any sort of Leicence on using this example ? Can it be used for both commercial and personal projects ? Thanks

  115. Peter July 14th

    Thom "very nice dude! U can publish a whole webpage in these list. It looks very good and its edit easier as easy! I think, more of plugins doesnt needed. Greez from Germany" Looks very nice and I would love to be able to get the whole webpage there. How do u do it?

  116. Myron July 24th

    This was mentioned above, but it wasn't clear to me. So here's a little more detail. With WordPress, one can't use the $() syntax. (Reference wordpress.org for more detail). To get this jQuery plugin to work in WordPress, replace '$' with 'jQuery'. I made this replacement in the .js file and in the script that invokes .js functions. For example, in jquery.featureList-1.0.0.js, replace this in line 11: use var tabs = $(this); with this: use var tabs = jQuery(this);

  117. naldi July 28th

    I certainly enjoyed the way you explore your experience and knowledge of the subject! Keep up on it. Thanks for sharing the info.Education.

  118. dr john July 29th

    It would be nicer if, on hovering over a feature which is not the current one, the one hovered over then became the current one that was revealed. A sort of tell me about this one now option.

Leave a Reply


jQueryGlobe