Saturday, December 31, 2011

jquery cycle example

When I came across this plugin and simple example first thing came to my minde that how to add “previous and Next” Button in slide show, so lets do it. I am using same HTML Code & CSS style used in“JQuery Cycle Plugin – Basic Example 2″. Please refer that so that you can understand.

  1. <div id="slide1" class="pics">  
  2.     <img src="images/beach1.jpg" height="200" width="200">  
  3.     <img src="images/beach2.jpg" height="200" width="200">  
  4.     <img src="images/beach3.jpg" height="200" width="200">  
  5. </div>  
  6. <div class="nav"><a href="#" id="prev">Prev</a> <a href="#" id="next">Next</a></div>  

CSS Style for previous and Next buttona long with configuration.

Example 1: jQuery cycle plugin previous and Next links for slider.

  1. $('#slide1').cycle({  
  2.     fx:     'fade',  
  3.     speed:  'fast',  
  4.     timeout: 0,  
  5.     next:   '#next',  
  6.     prev:   '#prev'  
  7. });  

Example 2: jQuery cycle plugin auto rotation. hover to pause, click to see next image.

  1. $('#slide1').cycle({  
  2.     fx:     'fade',  
  3.     speed:   300,  
  4.     timeout: 3000,  
  5.     next:   '#s3',  
  6.     pause:   1  
  7. });  

Example 3: jQuery cycle plugin – show numeric pagination.

  1. $('#slide1')  
  2. .before('  
  3. <div id="nav">')  
  4. .cycle({  
  5.     fx:     'turnDown',  
  6.     speed:  'fast',  
  7.     timeout: 0,  
  8.     pager:  '#nav'  
  9. });  
  10. </div>  

Quick Tips

  1. /* How to stop slide show  */  
  2. $('#slideshow').cycle('stop');  
  3.   
  4. /* How to pause slide show  */  
  5. $('#slideshow').cycle('pause');  
Share this nice post:

jquery Accordion menus examples

jQuery UI accordion:
The jQuery UI accordion widget is a great way to group logical sections of your page together and it can used very effectively for navigation.
jquery-ui-accordion
jquery-ui-accordion
Demo   Download

Simple Accordion with CSS and jQuery

Detailed tutorial how to create great looking accordion menu. It is really simple way to build a sliding accordion
jquery-simple-accordion
jquery-simple-accordion
Demo  Download
Accordionza – jQuery Plugin
Accordionza is a very flexible and lightweight jQuery accordion plugin.
Features:  Easily configure all effects and speed, pause on hover, autoplay and autorestart,  collapseable captions and more.
accodionza-jquery
Demo
Horizontal Accordion Menu
This versatile 1kb horizontal accordion script can be used for menus, images, presentation content and more. The script will automatically adjust to the number of elements in the accordion and the dimensions of the accordion.
horizontal-javascript-accordion-menus
horizontal-javascript-accordion-menus
Demo
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.
Demo Download

Happy New year

happy new year

Thursday, December 22, 2011

10 best jQuery Table Manipulation Plugins

This article we are sharing some useful jQuery table plugins for you to display, sort, filter and manipulate your data in table. These plugins help you to create superb tables which are easy to impliment.

1. DataTables
DataTables is a plug-in for the jQuery Javascript library. It is a highly flexible tool, based upon the foundations of progressive enhancement, which will add advanced interaction controls to any HTML table.
Features: ajax auto-loading of data, pagination, sorting columns, highlight sorted columns, extensive plug-in support, themeable by CSS.

2. Flexigrid
Lightweight but rich data grid with resizable columns and a scrolling data to match the headers, plus an ability to connect to an xml based data source using Ajax to load the content.

3. 2. TinySort
A plugin to sort child nodes by (sub) contents or attributes. It is very useful for ordering unordered lists or tables, but works on any type of node.
4. jTPS
jTPS is a datatable jQuery plugin that offers pagination, animated scrolling through pages and intelligent natural sorting capability.

5. Colorize – jQuery Table Plugin
Colorize is a jQuery plugin to add background color to alternate HTML table rows, highlight a row/column on mouse over, and colorize a row/column when you click your mouse button over it. You can colorize as many table rows or columns as you want. A repeat mouse click reverts the row/column to the original background color.

6. Fixed Header Tables
Fixed Header Tables takes valid table HTML and builds a fixed header as done in Microsoft excel and a scrolling body with optional footer.
7. jExpand
jExpand is ultra lightweight jQuery plugin that will make your tables expandable. Typical for line of business applications, this feature can help you organize tables better. This way, tables can hold more information such as images, lists, diagrams and other elements.
8. Column Hover
A jQuery-plugin that highlights whole columns in a table when hovering over them. It’s supporting tables with colspans and rowspans, too!

9. tablesorter
tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell. It supports multi-column sorting, cross-browser and easily extensible via its widget system.

10. Table Drag and Drop JQuery plugin
I’ve been using JQuery for a while now and really agree with its tag line that it’s the “The Write Less, Do More, JavaScript Library”. We’ve also got this code for dragging and dropping table rows that has proved very popular, so it seemed natural to combine the two and wrap up the table drag and drop as a JQuery plugin.

Reindex data in magento

There are different ways we can re-index data in magent.

Example 1: reindex data via magento admin panel.
Easiest way is to login magento admin panel, got o “Systems > Index Management” and select all indexs, action to “Reindex Data” and click on submit button.
Example 2: how to reindex data programmatically in magento?.
Magento has different 9 different indexes. If you want to refresh all of them then following code will help you.
  1. for ($i = 0; $i < = 8; $i++) {  
  2.     $process = Mage::getModel('index/process')->load($i);  
  3.     $process->reindexAll();  
  4. }  
Example 3: Out of the box data reindexing in magento?.
Create a file reindex.php and execute this file on linux command prompt. If you reindex data manually using following script it will resolve the problem like reindex is incomplete or still showing indexing from long time, etc.
PS: Change path for ‘Mage.php’ & “indexer.php” file path in following code according to environment.
  1. set_time_limit(0);  
  2. error_reporting(0);  
  3. require_once '/var/www/html/app/Mage.php';  
  4. umask(0);  
  5.   
  6. $indexer="/var/www/html/shell/indexer.php";  
  7.   
  8. if(file_exists($indexer))  
  9. {  
  10.                 $idxlist=array("catalog_product_attribute",  
  11.                                "catalog_product_price",  
  12.                                "catalog_product_flat",  
  13.                                "catalog_category_flat",  
  14.                                "catalog_category_product",  
  15.                                "catalog_url",  
  16.                                "catalogsearch_fulltext",  
  17.                                "cataloginventory_stock");  
  18.   
  19.         //reindex using magento command line  
  20.         foreach($idxlist as $idx)  
  21.         {  
  22.             echo "reindex $idx n ";  
  23.             exec("php /var/www/html/shell/indexer.php --reindex $idx");  
  24.         }  
  25.   
  26. }  
Example 4: simple command to reindex in magento?.
If you are very good in linux then go the command prompt and execute following command to reindex data.