Showing posts with label tutorial. Show all posts
Showing posts with label tutorial. Show all posts

Friday, 25 November 2011

Hello, world!

Every decent programming tutorial will start with a "Hello, world!" example and this tutorial is yet another one of them. In the previous chapter, we learned how to include jQuery on our page, so that we may start using all of its great features. You need to know a bit more about how jQuery works, before you can start writing your own code, but just to make sure that everything is working, and for you to see how simple jQuery is, let's kick off with a little example:

<div id="divTest1"></div>
<script type="text/javascript">
$("#divTest1").text("Hello, world!");
</script>

Okay, so we have a div tag with the id of "divTest1". In the JavaScript code we use the $ shortcut to access jQuery, then we select all elements with an id of "divTest1" (there is just one though) and set its text to "Hello, world!". You may not know enough about jQuery to understand why and how this works, but as you progress through this tutorial, all of the elements will be explained in detail.

Even such a simple task as this one would actually require quite a few extra keystrokes if you had to do it in plain JavaScript, with no help from jQuery:

<div id="divTest2"></div>
<script type="text/javascript">
document.getElementById("divTest2").innerHTML = "Hello, world!";
</script>

And it would be even longer if our HTML element didn't have an ID, but for instance just a class.

Normally though, you wait for the document to enter the READY state before you start manipulating its content. The above examples will work in most browsers and likely even work when you do more advanced stuff, but certain tasks may fail if you try to do them before the document is loaded and ready. Fortunately, jQuery makes this very easy as well, as we will see in the next chapter. After that, we will start looking into one of the most important aspects of jQuery, which has already been used in the above example: Selectors.

Thursday, 21 July 2011

Top 100 Popular jQuery Examples, Plugins and Tutorials

1. jQuery Lavalamp Menu
    It is the jQuery plugin that is based of Guillermo Rauch plugins for mootools and Ganesh Mawwaha’s jQuery 1.1.x plugins. Through the Sliding Doors CSS/Javascript method, you are able to add a background hover effect on HTML link lists with Lavalamp by utilizing the Eazing library.

2. Superfish Menus – Suckerfish on ‘roids,
    This jQuery plugin allows the development of improved Suckerfish style of dropdown menus from the existing pure CSS type of dropdown menu. The features that are added as a result of these include: a timed-delay on mouseout, automatic utilization of hoverIntent plugin when present; obligatory IE6 –hover capability; animated sub-menu; accessibility through keyboard tab key; generation of arrows to indicate the submenus; use of drop shadows for browsers that are capable; and many others.

3. jQuery Context Menu
    This jQuery plugin provides easy implementation, CSS styling, keyboard shortcuts and control methods.

4. Kwicks for jQuery
    This highly versatile and customizable widget had started as just a port for Mootools framework.

5. jQuery iPod-style Drilldown Menu
    jQuery has an iPod-style drilldown menu that helps users traverse hierarchical data with relative ease and control. This feature is very useful in organizing large data structures that don’t translate well into the traditional fly-out or dropdown menus.

 

6. jQuery File Tree
    This jQuery plugin is a configurable AJAX file-browser plugin where you use to create a fully interactive and customized file tree as little as one of the Javascript code.

7. Recreate Mootools Home Page-Inspired Navigation Effect
    Users of jQuery can recreate the same effects that you see in a Mootools.

8. CSS Sprites2 using jQuery
    One can use jQuery to implement CSS Sprites2. One distinct advantage of jQuery over the other javascript libraries is that it allows users to select elements on a pages using CSS-like syntax that we are already familiar with.

9. jQuery Accordion
    It is the jQuery plugin that allows the creation of the accordion menu. It can be used for nested lists, nested divs and definition lists. This plugin has options for structure specification, active element, when necessary, and animation customization.

IMAGE MANIPULATION


10. jQZoom
    It is the jQuery plugin that easily allows the creation a small magnifier window near an image or group of images on the web page. You decide to build jQZoom to embed big images in your B2B. This creates the jQZoom in your eCommerce websites or any other websites.

11. jCrop
    This jQuery plugin allows an easy and quick way of adding image-cropping functionality to web application. This functionality combines the use of typical plug in with a powerful cross-platform DHTML cropping engine that is compatible to common desktop graphics applications.

12. Captify 1.1.0
    It is a jQuery plugin that creates short and beautiful image captions that appear every time a user’s mouse passes over an image.

IMAGE GALLERIES AND VIEWERS


13. Simple Controls Gallery
    This jQuery tools displays and rotates images by fading it into view over the previous images using navigation controls that pop up when the mouse moves over the gallery.

14. Agile Carousel
    It is a jQuery plugin that provides for the easy creation of a custom carousel. This plugin makes use of PHP to call images from the folder that is specified by the user. Users can configure different options including slide timer length, controls, transition type, easing type and more.

TRANSITION EFFECTS


15. InnerFade
    It is a small jQuery plugin used in the jQuery Javascript Library. This plugin allows using fade effects on any element found within a container in and out. The elements may include divs, list items or images. In order to do this, you have to create your own slideshow and the produce a newsticker or an animation.

16. Easing Plugin
    It is the jQuery plugin that comes from GSGD that provides advanced easing options. This plugin can support a default easing mode. This allows you to set your preferred animation once for all animations. It uses the Robert Penners easing equations for all the transitions.

17. HighlightFade
    It is a jQuery plugin that allows the use of fading effects from one color to any other pre-selected colors at any transition speed and interval of color update using a color progression tactic that is customizable.

18. JQuery Cycle Plugin
    It is a jQuery plugin that is classified as basic slideshow plugin. It is based on the Slideshow plugin by Matt Oakes, jqShuffle plugin by Benjamin Sterling and the InnerFade plugin by Torsten Baldes. This plugin can do auto-stop, before and after callbacks, pause-on-hover, and many other transition effects.

jQUERY CAROUSEL


19. Riding Carousels using jQuery
    It is the jQuery plugin used for controlling items in a list in vertical or horizontal order. The list of items can be loaded with or without AJAX, or can be a static HTML content. It can be scrolled in either direction with or without animation effects.

COLOR PICKER


20. Farbtastic
    It is a jQuery plugin that allows you to add more color picker widgets in a page using Javascript. These widgets are linked to an element and will update the value of that element when one particular color is picked.

21. jQuery Color Picker

      It is a jQuery plugin


    that allows you to select color in a way that is almost the same as you pick colors in Adobe Photoshop. This jQuery plugin is a Flat mode element in a page and is easy to customize the look by simply changing the images. It also has powerful controls used for selecting the colors and fits easily into the viewport.

LIGHTBOX


22. jQuery ThickBox
    It is a jQuery plugin that is created using the jQuery library. The function of this jQuery plugin is to resize images that are bigger than the browser window and provides versatility in inline content, images, AJAX content and iFramed content. It will remain at the center of the window even if you change the size of the browser window or you scroll the pages.

23. SimpleModal Demos
    It is a jQuery plugin defined as lightweight plugin that creates a basic interface to provide a modal dialog. This jQuery plugin shall give developers a cross-browser overlay and a container that will contain data provided to SimpleModal

24. jQuery LightBox Plugin
    It is a jQuery plugin that provide an option to present an image on a page in a simple and elegant manner. Under this jQuery plugin, the lightboxes can be assembled in one group and provides many options for configurations. It also provides both the manual and automatic options to create and to start lightboxes.

25. Revealing Photo Slider
    This tool of jQuery allows to create a thumbnail photo gallery where clicking a button would reveal the entire photo and other information about the photo.

26. FancyBox
    This jQuery tool automatically scales large images to fit in windows by adding a nice drop-shadow under the zoomed item. This tool can be used to group items that are related and add navigation between them. It is totally customizable through CSS and settings.

27. Facebox Image and Content Viewer
    It is a lightweight plugin that displays images, divs and remote pages, through AJAX, inline on a page and on demand.

28. jQuery.popeye
    It is a jQuery plugin that converts an unordered list of images into a simple image gallery. When an image is clicked, it enlarges just like with LightBox.

FORM ELEMENTS AND VALIDATION


29. jQuery Form Validation
    It is a jQuery plugin that is fast, unobtrusive, scalable and easy to use validation plug in that offers a variety of methods for all types of validation needs. It comes from the very basic to the more complex schemes of validation.

30. Ajax Form Validation
    This refers to the client aspect of validation using Javascript. The username will perform the validation by checking with the server whether a chosen username is available and valid.

31. jQuery AlphaNumeric
    It is a jQuery plugin that uses javascript to allow you to control what characters a user can use and enter on text areas and text boxes.

32. jQuery.combobox –
    It is a jQuery plugin that provides a simple way of producing an HTML type of combobox from the existing HTML Select tags. This plug in was created to provide the solution on the limitation in styling of standard Select tag.

33. jQuery Checkbox
    It is a jQuery plugin that creates a replacement for the standard checkbox. This plugin allows you to modify the look of the elements of the checkbox in the page.

34. File Style Plugin
    It is a jQuery plugin that solves your problem with browsers that does let you style file inputs. This jQuery plugin also allows you to style filename field to normal textfield by using css.

35. Radio Button and Check Box Replacement
    This tool of jQuery replaces the check boxes and radio buttons with a more attractive display.

36. Submit a Form Without Page Refresh
    By using jQuery, you not only can add form validation to wordpress comments without any page reload but also submit your form without a page refresh.

37. jQuery AJAX Contact Form
    Users of jQuery can make an AJAX contact form with a “honeypot” to foil email bots, load success and error messages without leaving the page and provides descriptive error messages detailing the reasons for the failed validation of the submitted value.

38. jQuery Form Validation
    This form of jQuery can show form-input validators both the browser-side and server-side

STAR RATING


39. Simple Star Rating System
    It is a jQuery plugin used for star rating system. This jQuery system was created with the basic framework of the star rating system of Wil Stuckey. This jQuery plugin provides the solution on the problem of the original script requiring too much coding. It also did away with the requirement for developing a star system.

40. Half Star Rating Plugin
    It is a jQuery plugin that was developed in response to the clamor for an enhancement of the simple rating system of Ritesh Agrawal and allow for the use of half-star rating system.

TABLE PLUGINS


41. Table Sorter Plugin
    It is a jQuery plugin that is used to turn a standard HTML table with TBODY and THEAD tags into a table which is sortable without resorting to page refreshes. This jQuery plugin can effectively sort and parse multiple data including data in a cell that are linked.

42. Autoscroll Plugin for jQuery
    It is a jQuery plugin that provides for hotspot scrolling of webpages. This jQuery plugin will still work even with earlier versions of jQuery.

43. Scrollable HTML Table Plugin
    It is a jQuery plugin that is used to convert HTML tables into scrollable tables. This jQuery plugin solution does not require any additional coding.

44. Table Row CheckBox Toggle
    This jQuery tool adds a toggle function to any table row that you specify based on a CSS class name. This tool will toggle on by default any check boxes within that table row.

45. Tablesorter
    This is a jQuery plugin that allows you to turn a standard HTML table with <td> and <th> tags to a sortable table without refreshing the page. This plugin can successfully parse and sort many kinds of data in a cell.

46. TableEditor
    This tool allows flexible in-place editing of HTML tables. Users can easily drop handler functions to update.

ROUNDED CORNERS


47. jQuery Curvy Corners
    It is a jQuery plugin that allows for the creation of nice looking rounded corners without the use of images. It is a jQuery plugin considered to be unobtrusive and can work well with all major browsers which include iPhone. Another nice feature about this jQuery plugin is that the corners to be rounded and its radius can be set easily.

OTHER JQUERY PLUGINS


48. HeatColor Plugin
    It is a jQuery plugin that provides color to elements and determined by a value derived from that element. This derived value comes from a range of value which are either pre-designated or passed in. The element is then assigned a “heat” color which is derived from the position of the value within the range of values.

49. jQuery Date Picker
    It is a jQuery plugin that is considered unobtrusive and clean. It adds date-entry functionality to web forms and pages. It was created from the basics up in order to attain flexibility and extensibility. It has varied options of use that allow you to all a calendar widgets to web pages and forms.

DYNAMIC CONTENT


50. Create a Log-in Form with jQuery
    One can create a sliding panel that slides in to reveal new content and animate the height of the panel through jQuery.

51. Spoiler Revealer with jQuery
    This is a technique in jQuery that can hide and reveal content with animation effect once it is clicked.

52. AJAX Upload
    It is a jQuery plugin that provides for easy uploading of multiple files without having to refresh the page. This plugin also allows the use of any element to trigger the file selection window.

53. FCBKcomplete
    jQuery also provides users with Facebook-like dynamic inputs along pre-added and auto-complete values.

54. Create Accessible Charts Using jQuery and Canvas
    Users of jQuery can use the <canvas> element to illustrate HTML table data. This technique makes data in a table accessible and while the chart is being shown for visual improvement.

MANIPULATING CONTENT


55. jQuery Books Widget
    One can use jQuery with some custom Javascript to create interesting widgets like a browsable Amazon.com books widget.

56. Text Size Slider
    Users of jQuery can control the text size of an article on a page using a slider. This feature of jQuery allows the user to control exactly the size they prefer and is a very impressive feature to have on a site.

57. Pagination
    Users of jQuery can group large numbers of items into pages and present navigational elements that allow users to move easily from one page to another.

58. Coda-Slider
    This jQuery tool also groups items together through navigational elements that allow users to traverse the pages.

59. Slick Auto-Playing Featured-Content Slider
    This jQuery plugin allows users to cycle through panels and auto-playing different kinds of custom content. It features an arrow indicator to guide users on which panel he is currently viewing.

BROWSER TWEAKS


60. Setting Equal Heights with Query
    Through jQuery, users can utilize a script that can equalize the box heights within the same container to create a tidy grid.

61. jQuery IE6 PNG Transparency Fix
    This is a bug fix that uses jQuery selectors to automatically fix all PNG images in a page.

62. BGI Frame
    This jQuery tool helps users in dealing with IE z-index issues.

63. Fix Overflow
    This jQuery bug fix solves the issue on the scroll bar covering overflowing elements when the element is only one line.

64. Lazy Load
    This tool can delay the loading of images below the fold on long pages, loading the images only when the user scrolls down on that part of the page.

65. Maxlength
    This jQuery plugin automatically limits the number of characters a user can input in a field and giving feedback on how many spaces are remaining.

ANIMATION EFFECTS


66. Scrollable
    It is a lightweight and flexible jQuery plug-in used to create a scrollable content. It can contain any HTML, including images, forms, text, video or a combination of any of them.

67. Fading Menu-Replacing Content
    This jQuery tool lets users to utilize animation and change the way to style a page on-the-fly to react to events that happen on your page.

68. Build an Animated Cartoon Robot with jQuery
    jQuery is able to provide an animation effect that simulates a faux 3-D animated background just like what are seen on scrolling video games.

TOP jQUERY TIPS


69. Prevent Animation Queue Build-up
    Through jQuery, this natural queuing of animations is easy to code and user can move on to other important tasks

70. Rotate Through Tabbed Content
    Through this functionality of jQuery, the movement is more likely to catch the user’s eyes, thus increasing the chances they will notice the tabbed box and allow the user to see all the content of the box instead of just the first tab.

71. Stopping the Rotation
    This technique allows users to stop the rotating of tabs and stop it from switching when you are interacting with them. The technique involves some editing a couple of lines from the document ready function.

72. Build a Tabbed Content with CSS and jQuery
    This technique outlines the steps required to easily customize to fit the size and color scheme, use fixed or variable height, automatically rotate through the tabs and stop the rotation when the user needs to.

73. Advanced CSS Accordion Effect
    This technique is improved by the use of Javascript and all browsers will handle this technique even without JS enabled.

74. Consistent Base Font Size
    This is the best jQuery technique to gain control over your font sizes until IE finally support the resizing of text in pixels.

75. Maintain Consistent Margins
    This jQuery technique enables users to remove the margin and padding from every element instead of CSS resets.

76. Set a Float to Clear a Float
    This jQuery is one of the most important things to understand with CSS. However, it is also important to learn how to clear floats.

77. Image Replacement
    This image replacement technique involves the positioning an image over the top of the HTML. One feature of this technique is that even when images are disabled, the text is still visible.

78. Faux Columns
    This technique allows 2 adjacent columns with unequal amounts of content to have 1px tall background image being repeated vertically in the containing element of the 2 columns.

79. Animate a Hover with jQuery
    This technique allows users to animate an image while hovering over it and allow users to see information while doing that

80. Background Image Animation Using jQuery
    This technique involves producing animation effects by changing the position of the background image.

81. Animated Menu using jQuery
    This technique involves the use of animated menu using CSS, XHTML and javascript.

82. Create an Animated Navigation with CSS and jQuery
    This technique provides for the creation of a cool navigation enhanced with animation effect and visual feedback.

83.Load in and Animate Content with jQuery
    This technique uses AJAX functionality so that the content loads into the relevant container instead of having to navigate to another page.

84. Implementing Prototype’s Array Methods in jQuery
    This technique gives a particular array all the methods that Prototype adds to their Array and Enumerable objects.

85. 43,439 Reasons to Use Append() Correctly
    This technique provides for the proper way of using this jQuery method. Although an extremely easy and useful method to work with, it can significantly affect the performance of the page.

86. Collapsible Content Using jQuery
    This technique provides the steps in having the content collapsible through simple jQuery codes.

87. Minimize Manipulation of DOM
    We can further make the code faster if we cut down on the frequency that we insert into the DOM. Insertion operations of DOM will make things slow down.

88. Give context to your selectors
    When you use the selector, the entire DOM will be traversed as a result of the action. This can be a very expensive process.

jQUERY TUTORIALS


89. How jQuery Works
    This is a featured tutorial on jQuery by John Resig, the creator of jQuery. This is an ideal basic tutorial for those who are starting to learn jQuery for the first time.

90. jQuery in 15 Days
    This is a 15 day tutorial that turns you from a greenhorn to an expert in 15 days.

91. Bassistance
    This tutorial covers the basics of jQuery up to the more advanced topic like building plugins.

92. Remy Sharp’s Blog

      He has written numerous tutorials and plugins and he is also the person responsible for the very helpful


jQueryForDesigners
    website which also provides useful tutorials in answer to request of readers.

93. CSS Tricks
    This reference site is full of examples, tips, tricks, tutorials and news about cascading style sheets (CSS).

94. jQuery Cheat Sheets
    It provides to aspects of cheat sheets. These are: those made for iPod and other mobile devices; and those with the A4 cheat sheet.

95. How to Build jQuery Plugins

      One can try any of the following tutorials: A


Plugin Development Pattern

      ;


Developing a jQuery Plugin

      ; and


Building your First jQuery Plugin
    .

96. jQuery Pop-up Menu Tutorial
    This is a tutorial material that focuses on pop-up link menu.

97. The jSkinny on jQuery
    It is a tutorial that covers jQuery javascript library.

98. How to Get Anything You Want
    This is an introductory tutorial on traversal methods and jQuery selectors and their use in DOM navigation

99. It’s all about CSS

      As


    the title suggests, this tutorial is all about CSS selectors. Once you learn from this tutorial, you can now easily query the DOM.

100. jQuery Crash Course

      This tutorial is designed for web designers with advanced knowledge of codes.

jQuery Accordion Menus, Tutorials And Examples

30 jQuery Accordion Menus, Tutorials And Best Examples

1. Yup, Yet another JQuery Accordion Plugin


Simple free jQuery accordion plugin. Available in 4 versions. Check out the tutorial how to use it, get the code, and download all the source files. Some of the new features:

  • Built according to the JQuery Plugin pattern

  • No more need for menus to have an ID

  • An ‘active’ class is now added to each toggle that has an open panel below it

  • Panels that hold other things than lists. You can now add anything

  • Nested accordions


Check out the demo here.

Yup-yet-another-jquery-accordion-plugin-jquery-accordion-menus-resources-tutorials-examples

2. jQuery UI Demo


See examples of different use of accordion, see how to set it up, get the source and read about Options, Events, Theming.

User-interface-jquery-accordion-menus-resources-tutorials-examples

3. Stupid Simple jQuery Accordion Menu


Very detailed tutorial about including jQuery in your mockup, creating the JavaScript, creating CSS and HTML.  You can also view the demo and download all files.

Simple-stupid-jquery-accordion-menus-resources-tutorials-examples

4. Making Accordion Menu Using jQuery


In this post, you’ll see two examples of accordion. First menu’s visibility gets toggled on clicking on the header while the another menu’s visibility gets toggled when mouse is moved over it. See the tutorial and download source files as well.

Making-using-jquery-accordion-menus-resources-tutorials-examples

5. jQuery Accordion Menu


Step by step tutorial that will take you through the creation of a jQuery accordion menu. Of course, you can view the demo and download source files.

Lateral-code-jquery-accordion-menus-resources-tutorials-examples

6. jQuery Examples – Horizontal Accordion


Learn how to create easy horizontal accordion menu.

Examples-horizontal-tutorial-jquery-accordion-menus-resources-tutorials-examples

7. jQuery – Horizontal Accordion


This jQuery plugin allows you to easily transform any unordered list into a horizontal menu. Explore tutorial, see documentation and different examples of use here.

Horizontal-tutorial-jquery-accordion-menus-resources-tutorials-examples

8. State-Saving jQuery Accordion Menu Without Reloading the Page


Learn how to create tweaked accordion menu, in which you can bookmark and re-access sections without re-clicking on them. View demo and download source too.

State-saving-jquery-without-reloading-the-page-tutorial-jquery-accordion-menus-resources-tutorials-examples

9. Accordion Menu Screencast Tutorial


Learn how to build a simple, unobtrusive, accordion style menu using basic events and animations.

Screencast-tutorial-jquery-accordion-menus-resources-tutorials-examples

10. Regular and Hover Accordion Menus


See example of hover accordion menu, learn how to create it and download the plugins.

Regular-hover-jquery-accordion-menus-resources-tutorials-examples

11. Haccordion – Simple Horizontal Accordion Plugin for jQuery


Simple and fast plugin for creating simple horizontal accordion menus. Demo included.

Haccordion-simple-horizontal-accordion-plugin-for-jquery-accordion-menus-resources-tutorials-examples

12. Exactly How to Create a Custom jQuery Accordion


The plan for this tutorial is to show how to create an accordion using the jQuery UI function, then create one using some custom coding. You’ll be using a blog sidebar as an example. View demo and get the source.

Exactly-how-to-create-custom-jquery-accordion-tutorial-jquery-accordion-menus-resources-tutorials-examples

13. Simple Accordion w/ CSS and jQuery


Detailed tutorial how to create great looking accordion menu. You can also check out Toggle tutorial. View demo.

Simple-witch-css-jquery-accordion-menus-resources-tutorials-examples

14. Accordion Madness


One of the options how to create accordion menu.

Madness-jquery-accordion-menus-resources-tutorials-examples

15. A Simple and Beautiful jQuery Accordion Tutorial


Learn how to create the well-known JavaScript accordion with the most minimal amount of HTML, CSS, JS and of course, with a beautiful interface as well. Check out demo and download source.

Simple-beautiful-tutorial-jquery-accordion-menus-resources-tutorials-examples

16. Slide Out and Drawer Effect


This tutorial will walk through how to create your own simple plugin, and then replicate the Apple downloads drawers using the very excellent Accordion plugin. Demo and code included.

Slide-drawer-jquery-accordion-menus-resources-tutorials-examples

17. Create Simplest Accordion Menu using jQuery


Another simple tutorial how to create standard accordion menu. View demo and download files.

Simplest-menu-using-jquery-accordion-menus-resources-tutorials-examples

18. TinyAccordion JavaScript Accordion


This lightweight (1.2 KB) JavaScript accordion can easily be customized to integrate with any website. It now includes multi-level support, a parameter to determine whether only one panel can be expanded concurrently, and a hide/show all toggle. For more information visit leigeber.com.

Tiny-javascript-jquery-accordion-menus-resources-tutorials-examples

19. Javascript Accordion Menu Wizard


Javascript Accordion Menu is an image based site navigation menu. Scriptocean Accordion Menu Wizard supports horizontal and vertical accordion menus. Download here.

Javascript-menu-wizard-jquery-accordion-menus-resources-tutorials-examples

20. Horizontal JavaScript Accordion 1kb


This versatile 1kb horizontal accordion script can be used for menus, images, presentation content and more.

Horizontal-javascript-1kb-jquery-accordion-menus-resources-tutorials-examples

Examples


21. Alex Cohaniuc Portfolio


Alex-cohaniuc-jquery-accordion-menus-resources-tutorials-examples

22. Deluge Studios


Deluge-studios-jquery-accordion-menus-resources-tutorials-examples

23. Rzmota


Rzmota-jquery-accordion-menus-resources-tutorials-examples

24. Screenfluent


Screenfluent-jquery-accordion-menus-resources-tutorials-examples

25. Artisanmedia


Art-is-a-media-jquery-accordion-menus-resources-tutorials-examples

26. Exotics RTC


Exotics-rtc-jquery-accordion-menus-resources-tutorials-examples

27. Two Chaps


Two-chaps-branding-jquery-accordion-menus-resources-tutorials-examples

28. Ten 18 Photography


Ten-18-photography-jquery-accordion-menus-resources-tutorials-examples

29. We Are Lighthouse


We-are-lighthouse-jquery-accordion-menus-resources-tutorials-examples

30. DJ Eric C


Dj-eric-c-jquery-accordion-menus-resources-tutorials-examples

Extra: Grid Accordion – $8


Perfect for a grid gallery. The usual worry about displaying multiple images at the same time is eliminated here because of its smart code structure. Seen in Code Canyon, a marketplace of Envato where all sold items are topnotch in quality because before they even get to be showcased, experts see to it that products are up to standards. Plus very warm support from the coder himself/herself!


Enhanced by Zemanta

Friday, 6 May 2011

Create A Vertical Scrolling News Ticker With jQuery and jCarousel Lite

                                


News Ticker is a fantastic way to present headlines or minor updates to your readers. The smooth scrolling effect will attract your readers and generate more clicks to your site.

There are a lot of great tutorials discussing on how to implement news ticker, however most of the tutorials that i found are not really suitable for a beginner. So, i decided to use jQuery and its plugin jCarousel Lite to create a simple yet powerful news ticker.

Why i choose jCarousel Lite? it is because jCarousel Lite is a tiny but powerful plugin. Furthermore, you can easily tweak/configure it to achieve different effects. News ticker is just a sample application for this plugin.

Let’s start to create our news ticker using jCarousel Lite. Download both jQuery and jCarousel Lite before we can start.

news-ticker

Step 1


Let’s create a blank index.htm file, and include jQuery and jCarousel Lite. Also, create a blank style.css file for later use.
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script src="jquery-latest.pack.js" type="text/javascript"></script>
<script src="jcarousellite_1.0.1c4.js" type="text/javascript"></script>
</head>
</html>

Step 2


In the same document, create a <div> and name it as “newsticker-demo”. Basically, this is the container for the news ticker. We will have another <div> class name “newsticker-jcarousellite”. Remember, this is very important and you will need to use the same class name when you configure jCarousel Lite.

Step 3


In the “newsticker-jcarousellite” <div>, create an <ul> element. Each news will be an individual <li> element. In this example, i had created 6 news, so i will have 6 <li> elements(but i am not going to show all). We will have the thumbnail float to the left, while the title and other information float to the right.
<li>
<div>
<a href="#"><img src="images/1.jpg"></a>
</div>
<div>
<a href="http://www.vladstudio.com/wallpaper/?knight_lady">
The Knight and the Lady</a>
<span>Category: Illustrations</span>
</div>
<div></div>
</li>

Step 4


After you created your <li> element, it is the time for us to configure the jCarousel. Under the <head>, add these scripts:
<script type="text/javascript">
$(function() {
$(".newsticker-jcarousellite").jCarouselLite({
vertical: true,
visible: 3,
auto:500,
speed:1000
});
});
</script>

The script itself is pretty straight forward. The “auto:500″ means it will auto-scroll every 500ms. There are a lot of options which you can configure easily. Refer the documentation for more information.

Step 5


Basically you had done everything, except styling your content. So, just copy and paste the scripts below in your style.css file.
* { margin:0; padding:0; }

#newsticker-demo {
width:310px;
background:#EAF4F5;
padding:5px 5px 0;
font-family:Verdana,Arial,Sans-Serif;
font-size:12px;
margin:20px auto;
}

#newsticker-demo a { text-decoration:none; }
#newsticker-demo img { border: 2px solid #FFFFFF; }

#newsticker-demo .title {
text-align:center;
font-size:14px;
font-weight:bold;
padding:5px;
}

.newsticker-jcarousellite { width:300px; }
.newsticker-jcarousellite ul li{ list-style:none; display:block; padding-bottom:1px; margin-bottom:5px; }
.newsticker-jcarousellite .thumbnail { float:left; width:110px; }
.newsticker-jcarousellite .info { float:right; width:190px; }
.newsticker-jcarousellite .info span.cat { display: block; font-size:10px; color:#808080; }.clear { clear: both; }

Finish!


Enhanced by Zemanta