<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Alpha Codes</title><description>Dedicated blog for web development coding , where coding must be simple and available to all for free....</description><managingEditor>noreply@blogger.com (Unknown)</managingEditor><pubDate>Thu, 19 Sep 2024 16:58:37 +0530</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">18</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://sreevathsabv.blogspot.com/</link><language>en-us</language><item><title>jquery to search and highlight words in html</title><link>http://sreevathsabv.blogspot.com/2012/04/jquery-to-search-and-highlight-words-in.html</link><category>javascript</category><category>jquery</category><category>search HTML</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sun, 13 Oct 2013 10:55:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-1066917910659683855</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Today, i have worked on a very simple script to search and highlight words in jquery inside HTML. Let's get started, shall we?&lt;br /&gt;
&lt;br /&gt;
Let me explain the basic logic first. The idea is to look into the browser object's content and try to match the word or phrase using the regular expression. Then , the object is replaced with the highlighted css, if the search matches.&lt;br /&gt;
&lt;br /&gt;
First, the jQuery code, later the explanation...&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
function replaceText() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;$("body").find(".highlight").removeClass("highlight");&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
var searchword = $("#searchtxt").val();&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
var filter = new RegExp("\\b"+searchword+"\\b", "ig");&lt;br /&gt;
&lt;br /&gt;
if(searchword!=""){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$("body").each(function( ) { &lt;br /&gt;
$(this).html($(this).html().replace(filter,"&amp;lt;span class='highlight'&amp;gt;" + searchword + "&amp;lt;/span&amp;gt;")) ; &lt;br /&gt;
});&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
1.&amp;nbsp; $("body").find(".highlight").removeClass("highlight");&lt;br /&gt;
This line removes the previously highlighted searched words &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;2.&amp;nbsp; var filter = new RegExp("\\b"+searchword+"\\b", "ig"); &lt;br /&gt;
\\b is used to check for complete word or phrase, "i" is used to ignore case and "g" is used to search pattern throughout string. Look at this&amp;nbsp;&lt;a href="http://lawrence.ecorp.net/inet/samples/regexp-intro.php" target="_blank"&gt;Javascript regular expression&lt;/a&gt; link for more info. (of course, you can use more complex pattern matches)&lt;br /&gt;
&lt;br /&gt;
3. &amp;nbsp; $("body").each(function( ) {...});&lt;br /&gt;
I am looking for the search word throughout the 'body' element, hence , for each word in element, am comparing the lookup text. If you want to search for a particular content or block of content, then use the element ID, for example $("#division").each(function(){});&lt;br /&gt;
&lt;br /&gt;
4.&amp;nbsp; $(this).html($(this).html().replace(filter,"&amp;lt;span class='highlight'&amp;gt;" + searchword + "&amp;lt;/span&amp;gt;")) ;&lt;br /&gt;
$(this) here refer to 'body' element, using java script's " replace"&amp;nbsp; function we are replacing the searched word with the filtered word, with little css to highlight it!.&lt;br /&gt;
&lt;br /&gt;
CSS&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;style&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
.highlight{ background:#00FF00; padding:1px; border:#00CC00 dotted 1px; }&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;/style&amp;gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Content&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;body &amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;input type="text" id="searchtxt" /&amp;gt;&amp;lt;input type="button"&amp;nbsp; value="search" onClick="replaceText();" id="highlightButton" /&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;p&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
The ACM Digital Library, a part of the ACM Portal, contains a comprehensive archive of the organization's journals, magazines, and conference proceedings. Online services include a forum called Ubiquity and Tech News digest.&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
ACM requires the copyright of all submissions to be assigned to the organization as a condition of publishing the work.[2] Authors may post the documents on their own websites, but they are required to link back to the digital library's reference page for the paper. Though authors are not allowed to charge for access to copies of their work, downloading a copy from the ACM site requires a paid subscription.&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;&lt;br /&gt;
Just added a text box and a button ; onclick of which search is triggered!.&lt;br /&gt;
&lt;br /&gt;
Is it not really simple?, But wait....&lt;br /&gt;
&lt;br /&gt;
There is a disadvantage that am bound to.&lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;If a search string is in lower case , on highlighting the same, the actual word is replaced with the searched word along with css, hence the word "The" becomes "the" with highlight at beginning of a sentence, which is grammatically in correct.&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;DEMO LOOK&lt;/b&gt;: &lt;br /&gt;
&lt;ul style="text-align: left;"&gt;
&lt;/ul&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-sx2sxHXMipPdaB0UUoJjxE4CW62goKjFABZ1ApXEwytQbD4lVhH16IIrfMDmqce_HeiXMEqxtlsGvFtRDF4ZGzgVBVFREHQUl7GjABuiWdziJ58gcSgdYp7nRVQgjW67kf1jJCLpN9o8/s1600/untitled.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-sx2sxHXMipPdaB0UUoJjxE4CW62goKjFABZ1ApXEwytQbD4lVhH16IIrfMDmqce_HeiXMEqxtlsGvFtRDF4ZGzgVBVFREHQUl7GjABuiWdziJ58gcSgdYp7nRVQgjW67kf1jJCLpN9o8/s640/untitled.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Please suggest (through comment) any solution to overcome the above disadvantage and any other fault you find , so that many are benefited with it!!.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Please subscribe if found useful&amp;nbsp; and click on above links to see more cool codes&amp;nbsp; :)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-sx2sxHXMipPdaB0UUoJjxE4CW62goKjFABZ1ApXEwytQbD4lVhH16IIrfMDmqce_HeiXMEqxtlsGvFtRDF4ZGzgVBVFREHQUl7GjABuiWdziJ58gcSgdYp7nRVQgjW67kf1jJCLpN9o8/s72-c/untitled.JPG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>Google like page load in Jquery ajax (dynamic page load)</title><link>http://sreevathsabv.blogspot.com/2011/06/google-like-page-load-in-jquery-ajax.html</link><category>ajax</category><category>dynamic page load</category><category>google like</category><category>javascript</category><category>jquery</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sun, 13 Oct 2013 10:21:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-2088765763594496115</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi ,&lt;br /&gt;
&lt;br /&gt;
Today, i would teach you a very simple method to load multiple pages into a single page, without showing page URL's.in the address bar.&lt;br /&gt;
&lt;br /&gt;
I am using Jquery, ajax to achieve the below.&lt;br /&gt;
&lt;br /&gt;
First, let us create a page html/php(say index.php) and let us create two DOM objects. one is the button and another division, where the external pages are loaded dynamically.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;
&amp;lt;input type="button" value="load"/&amp;gt; - creates the button.&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;div id="page_loader"&amp;gt;&amp;lt;/div&amp;gt; - create div to load page into it.&lt;/div&gt;
&lt;br /&gt;
Now , let us write a function in Jquery to load pages on the fly.&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
function loadpage(page){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; url:page,&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; beforeSend:function(){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $('#page_loader').html("Please wait...");&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; success:function(data){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $('#page_loader').html(""); // to empty previous page contents.&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $('#page_loader').html(data);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;br /&gt;
Now , from the button click, pass the page that you would like to load.&lt;br /&gt;
For e.g , if you want to load a contact page contact.php.. simply call the function like this...&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;
&amp;lt;input type="button" value="load" onclick="loadpage('contact.php')"/&amp;gt;&lt;/div&gt;
&lt;br /&gt;
On click of the button , the contact.php page will be loaded into the "page_loader" division in the index.php page. Like this we can load 'n' number of pages in a single page.&lt;br /&gt;
&lt;br /&gt;
Please subscribe for more cool codes :) &lt;br /&gt;
&lt;br /&gt;
That's it guys feedback's are welcome! :)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15619949-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
&lt;/script&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>Google like menu in jquery</title><link>http://sreevathsabv.blogspot.com/2012/03/google-like-menu-in-jquery.html</link><category>google menu</category><category>javascript</category><category>jquery</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sun, 13 Oct 2013 00:33:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-7451820141974129402</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I just love google's new look, especially the menus in Beta version. 
have you noticed the border that appears for each link which you have 
selected?. Well lets learn how to create one such fantastic menu button 
using jquery and css.&lt;br /&gt;
&lt;br /&gt;
Include jquery library&lt;br /&gt;
&lt;br /&gt;
create a HTML page and few link texts&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;div id="menu"&amp;gt;&lt;br /&gt;
&amp;lt;div class="normal"&amp;gt; Everything &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class="normal"&amp;gt; Images &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class="normal"&amp;gt; Maps &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #cccccc;"&gt;
&lt;/div&gt;
&lt;br /&gt;
Write a little css fo the same&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
.normal{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; width:100px; height:30px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; margin:5px; padding:5px 5px 5px 15px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; background: #FFFFF; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; text-align:left; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border:#fff solid 5px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor:pointer;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.clicked{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; width:100px; height:30px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; margin:5px; padding:5px 5px 5px 15px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; background: #FFFFF; color:#FF0000;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; text-align:left; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border-left:#00cc00 solid 5px; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cursor:pointer; &lt;br /&gt;
}&lt;/div&gt;
&lt;br /&gt;
Now the Jquery to perform magic&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$(document).ready(function () {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#menu &amp;gt; div").each(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $("#menu &amp;gt; div").click(function() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $("#menu &amp;gt; div").removeClass("clicked");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $(this).addClass("clicked").animate({ borderLeftWidth: "5px" }, 1500 );&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
});&lt;/div&gt;
&lt;br /&gt;
Thats it guys!!&lt;br /&gt;
&lt;br /&gt;
Please subscribe if found useful&amp;nbsp; and click on other links to see more cool codes&amp;nbsp; :)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;DEMO LOOK&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh-cmDboxQgEHVFaTU3Zh4lhh8_mGH_CTvOLbxoMWbaXbNdAH1VF9fo2VC3Ie_mqay7PseHpYCQFJ-zeqr0VNzWrikH9r73QftwL5bjYUF6f3fNV_KvyizJRfaO8l3mQrGVizdaCaxRAmM/s1600/g+menu.JPG" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh-cmDboxQgEHVFaTU3Zh4lhh8_mGH_CTvOLbxoMWbaXbNdAH1VF9fo2VC3Ie_mqay7PseHpYCQFJ-zeqr0VNzWrikH9r73QftwL5bjYUF6f3fNV_KvyizJRfaO8l3mQrGVizdaCaxRAmM/s640/g+menu.JPG" height="352" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Google beta Menu&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh-cmDboxQgEHVFaTU3Zh4lhh8_mGH_CTvOLbxoMWbaXbNdAH1VF9fo2VC3Ie_mqay7PseHpYCQFJ-zeqr0VNzWrikH9r73QftwL5bjYUF6f3fNV_KvyizJRfaO8l3mQrGVizdaCaxRAmM/s72-c/g+menu.JPG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>jQuery to export html table data into excel sheet</title><link>http://sreevathsabv.blogspot.com/2012/07/jquery-to-export-html-table-data-into.html</link><category>export excel sheet</category><category>html table</category><category>import MS excel</category><category>jquery</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sun, 13 Oct 2013 00:07:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-8778502224160450873</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Simple script to export html table or PHP data to excel sheet using jQuery, without having to write separate script again in php.&lt;br /&gt;
&lt;br /&gt;
The basic idea is to take the html data as a screen shot and render it into excel output using jQuery.&lt;br /&gt;
&lt;br /&gt;
Here is how it is done.&lt;br /&gt;
&lt;br /&gt;
Wrap a div with an ID around the data that needs to be exported. Attach the form at the end of the data with an hidden text element&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; text-align: left;"&gt;
&amp;nbsp;&amp;lt;div id="excelExportDivision"&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table cellpadding="5" cellspacing="5" border="1"&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Blog&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;http://www.sreevathsabv.blogspot.com&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form style="display:hidden" name="hiddenForm" id="hiddenForm" method="post" action="export_file.php"&amp;gt;&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type="hidden" id="hiddenExportText" name="hiddenExportText"&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;input type="button" value="Submit" onclick = "excel_export();"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="background-color: #f4cccc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
Next we will see a simple jQuery script , on click of which we trigger a page call, where headers for excel export is coded.&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
function excel_export(){&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
var content = document.getElementById('excelExportDivision').innerHTML;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$('#hiddenExportText').val(content);&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
document.getElementById("hiddenForm").submit();&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
} &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
You can call the function like so , &amp;nbsp;&amp;lt;input type="button" onclick="excel_export();" value="submit"/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
..... and finally the export_file.php page.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;?php&lt;br /&gt;
header('Content-type: application/vnd.ms-excel');                                                                                                     &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
header("Content-Disposition: attachment; filename=BOBreport.xls");                                                            &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
header("Pragma: no-cache");     &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
header("Expires: 0");&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc;"&gt;echo $_REQUEST['hiddenExportText'];&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span style="color: red;"&gt;&lt;b&gt;NOTE: I HAVE MADE SOME CHANGES AS SOME OF MY FRIENDS HAVE COMMENTED THAT IT IS NOT WORKING. IT"S FIXED AND WORKING... :)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;br /&gt;
This is as simple as i can suggest you to export the php data into excel sheet.&lt;br /&gt;
&lt;br /&gt;
It is amazingly fast and reliable.&lt;br /&gt;
&lt;br /&gt;
Subscribe for more cool codes and see the other links below for more cool stuff!!&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">8</thr:total></item><item><title>Custom news ticker script using jQuery</title><link>http://sreevathsabv.blogspot.com/2012/07/custom-news-ticker-script-using-jquery.html</link><category>jquery</category><category>news ticker script</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 23:35:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-3357632651378471987</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi everyone!&lt;br /&gt;
&lt;br /&gt;
Here is a piece of cake , a custom news ticker script using jquery.&lt;br /&gt;
&lt;br /&gt;
First create a division and write all the tickers inside the "&amp;lt;li&amp;gt;" tags.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: white;"&gt;&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ul id="news"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;li&amp;gt;First news ticker text&amp;lt;/li&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;li&amp;gt;Second news ticker text &amp;lt;/li&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;/div&amp;gt; &lt;/div&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="background-color: white;"&gt;Next add some css to hide the &amp;lt;li&amp;gt; texts and style up your news box column as you like.&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: white;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: white;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
#news{&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
&amp;nbsp; &amp;nbsp; height: 50px;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
&amp;nbsp; &amp;nbsp; overflow: hidden !important;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
&amp;nbsp; &amp;nbsp; border-bottom:#F00 1px dashed; margin:opx auto;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
#news li {&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
&amp;nbsp; &amp;nbsp;height: 50px;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Now a very simple jQuery script to bring your news ticker to life&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
//function to find the texts other then the first text&lt;/div&gt;
&lt;div style="background-color: #f4cccc; text-align: justify;"&gt;
&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
function newstick(){&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$('#news li:first').animate({'opacity':0}, 200, function () { $(this).appendTo($('#news')).css('opacity', 1); });&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
// This will automatically call the next tickers for a time interval of 4 sec&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
setInterval(function(){ newstick() }, 4000);&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Thats it! told you was a piece of cake!&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Tested with latest browsers only. Let me know your thoughts through comments!&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
subscribe for more cool codes and see the other links below!.&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Have a great day! :)&amp;nbsp;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Using multiple accordion in jquery with single function</title><link>http://sreevathsabv.blogspot.com/2012/03/using-multiple-accordion-in-jquery-with.html</link><category>javscript</category><category>jquery</category><category>jquery UI</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 23:03:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-3079034008547619622</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I was working on an application recently and i had to use accordion in multiple places and pages. Of-course this was a extra space and time. So, i came up with an idea to make my own accordion in&lt;br /&gt;
&amp;nbsp;jQuery which can be called any time with help a single function.This could not be a complete solution, but certainly has re usability.&lt;br /&gt;
Today i will be sharing this knowledge with you all and hope it would be helpful.&lt;br /&gt;
&lt;br /&gt;
First create a function pass two variables to the function. first parameter is link field with which we click to toggle , second parameter is the division which opens and closes data. rest is a simple logic as you can see.Note that parameter are nothing but your div ID's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
var Toggled=false;&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc;"&gt;$(document).ready(function() {&lt;/span&gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc;"&gt;function custom_accordion(linker,changer)&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $('#'+linker).click(function(){&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if(Toggled==false)&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $('#'+linker).html("Hide");&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $("#"+changer).fadeIn(100); &lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toggled=true;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $('#'+linker).html("Change");&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $("#"+changer).fadeOut(100);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Toggled=false;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;}); &lt;/span&gt;&lt;/div&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;span style="background-color: white;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
call this for each page and forget manual coding to check if you need to place accordion or not..&lt;br /&gt;
&lt;br /&gt;
That's it guys , feedback's are welcome!!.&lt;br /&gt;
&lt;br /&gt;
below are some other useful links, click and explore!!! :)&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>PHP code to connect multiple MySQL server,multiple database simultaneously</title><link>http://sreevathsabv.blogspot.com/2012/03/php-code-to-connect-multiple-mysql.html</link><category>multiple database connect</category><category>multiple mysql database connection</category><category>mysql</category><category>php</category><category>php script</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 20:23:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-6106623427672852279</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div style="font-family: inherit;"&gt;
Have you ever tried to connect two different servers and tried to query MySQL database located in each server, to produce a single result from a single query?. If yes, probably you would be disappointed as much as i was. As far as i know, this cannot be achieved in one shot!.&amp;nbsp;&lt;/div&gt;
&lt;div style="font-family: inherit;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: inherit;"&gt;
Therefore, i would walk you in this post, on,&amp;nbsp; how to achieve the same using a different approach.&lt;/div&gt;
&lt;ul style="font-family: inherit; text-align: left;"&gt;
&lt;li&gt;You must always have two step approach for this.&lt;/li&gt;
&lt;li&gt;open connection to both the servers from PHP script&lt;/li&gt;
&lt;li&gt;query first server with first connection. close the connection.&lt;/li&gt;
&lt;li&gt;query second server with second server. close the connection.&lt;/li&gt;
&lt;li&gt;fetch the resultant rows &lt;/li&gt;
&lt;li&gt;merge the resultant array using &lt;a href="http://php.net/manual/en/function.array-merge.php" target="_blank"&gt;array_merge()&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;
&lt;div style="font-family: inherit;"&gt;
The following php code would help you understand completely how its done.&lt;/div&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$dbh1 = mysql_connect('server1', 'username', 'password')or die("Unable to connect to MySQL1"); &lt;br /&gt;
$dbh2 = mysql_connect('server2', 'username', 'password') or die("Unable to connect to MySQL2");&lt;br /&gt;
&lt;br /&gt;
mysql_select_db('db1', $dbh1);&lt;br /&gt;
mysql_select_db('db2', $dbh2);&lt;br /&gt;
$ar = array();$ar2 = array();&lt;br /&gt;
&lt;br /&gt;
$qry1 = mysql_query("select * from db1.table1 where db1.table1.id='261' and db1.table1.id=db1.table1.id",$dbh1) or die(mysql_error());&lt;br /&gt;
while($row = mysql_fetch_array($qry1))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $ar[] = $row;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$qry2 = mysql_query("select * from db2.table1 where db2.table1.id='421' and db2.table1.id=db2.table1.id",$dbh2) or die(mysql_error());&lt;br /&gt;
while($row2 = mysql_fetch_array($qry2))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $ar2[] = $row2;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$result = array_merge($ar, $ar2);&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
// using for loop to retrieve data&lt;br /&gt;
for($i=0;$i&amp;lt;count($result);$i++)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $result[$i]['realname'].'&amp;lt;br&amp;gt;';&lt;br /&gt;
}&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
// using for each loop to retrieve data &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
foreach($result as $k=&amp;gt;$val)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $val['realname']. '&amp;lt;br&amp;gt;';&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
}&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
// using while loop to retrieve data &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
while(list($key, $value) = each($result)){&lt;br /&gt;
&amp;nbsp;echo $value['realname']. '&amp;lt;br&amp;gt;';&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
?&amp;gt; &lt;/div&gt;
&lt;br /&gt;
&lt;div style="font-family: inherit;"&gt;
Disadvantage:&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;Of course , if you are using a highly complex query this is not the preferred approach,&amp;nbsp; since , you need more execution and just because of code complexity itself.&lt;/li&gt;
&lt;li&gt;The resultant array of result returned would contain duplicate values and you have to sort it with a different approach using array sort etc...&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="font-family: inherit;"&gt;
Please subscribe for more cool codes :)&lt;br /&gt;
&lt;br /&gt;
Thats all guys feedbacks are welcome.&lt;/div&gt;
&lt;div style="font-family: inherit;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="font-family: inherit;"&gt;
Check out the my other links for other cool stuffs!! :)&lt;/div&gt;
&lt;div style="font-family: inherit;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>swipe detection for android-ipad device using jQuery mobile</title><link>http://sreevathsabv.blogspot.com/2012/03/swipe-detection-for-androidipad-device.html</link><category>android</category><category>ipad</category><category>jquery</category><category>jquery UI</category><category>mobile swipe detection</category><category>swipe detection</category><category>tablet</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 19:33:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-2591309482283401578</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Here is the most simple script to detect the browser swipe feature using jquery mobile for android and ipad devices.ofcourse, we can work around the same example in regular browsing as well...&lt;br /&gt;
&lt;br /&gt;
First , you need to &lt;a href="http://jquerymobile.com/download/" target="_blank"&gt;download&lt;/a&gt; and add jquery mobile kit , to your current page.&lt;br /&gt;
&lt;br /&gt;
You can use the jquery &lt;i&gt;live&lt;/i&gt; method to bind the DOM element, as of jquery 1.7 use &lt;i&gt;on&lt;/i&gt; method instead if &lt;i&gt;live&lt;/i&gt;, which needs to be swapped for. Here, am using body element itself. Use jquery's &lt;i&gt;swipeleft&lt;/i&gt;&amp;nbsp; and &lt;i&gt;swiperight&lt;/i&gt; event to produce the desired effect, like slide transition etc.. for now i would just alert when a event occurs.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$('body').live('swipeleft swiperight',function(event){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (event.type == "swiperight") {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("swipped right side");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (event.type == "swipeleft") {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert("swipped left side");&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; event.preventDefault();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/div&gt;
&lt;br /&gt;
If you would want the page to be moved to left or right like that of ipad, then here is an additional code.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$('body').live('swipeleft swiperight',function(event){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (event.type == "swiperight") {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery.mobile.changePage("#page2",{transition:'slide'}); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (event.type == "swipeleft") {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery.mobile.changePage("#page1", {transition:'slide'});&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; event.preventDefault();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;/div&gt;
&lt;br /&gt;
pretty simple ha? , feedback are welcome..&lt;br /&gt;
&lt;br /&gt;
Please subscribe for more cool code. &lt;br /&gt;
&lt;br /&gt;
check out other links for cool stuff.... :)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>how to install addons offline in Mozilla firefox</title><link>http://sreevathsabv.blogspot.com/2011/07/how-to-install-addons-offline-in.html</link><category>installation</category><category>mozilla addon</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 18:18:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-3191846298486087656</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
1. First, You need to go the download page of the addons that you want.&lt;br /&gt;
2. rightclick on the download button and save link as in the PC.(of course you need to have Internet for this :) )&lt;br /&gt;
3. The link will be saved as " &lt;b&gt;.xpi &lt;/b&gt;" format.&lt;br /&gt;
4. while you are offline,. simply open Mozilla firefor&amp;gt;Tools&amp;gt;Addons&amp;gt;Extensions, drag and drop the "&lt;b&gt;.xpi&lt;/b&gt;" file here.&lt;br /&gt;
5. Restart mozilla and enjoy offline coding!!&lt;br /&gt;
&lt;br /&gt;
Thats it guys feedback's welcome.!&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Page scroll for ipad-android device using javascript-jquery</title><link>http://sreevathsabv.blogspot.com/2012/04/page-scroll-for-ipadandroid-device.html</link><category>android</category><category>ipad</category><category>javascript</category><category>jquery</category><category>mobile page scroll script</category><category>page scroll</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 16:48:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-5130855319917804638</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I am really inspired by ipad page scroll UI, it looks so smooth and elegant. So, i decided to write something for a page scroll for ipad/android device using javascript/jquery.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;The logic is quiet simple, really, you will have the inner references for a DIV element (or any DOM element) to which you can scroll your lengthy page into ,just dock the DOM on top of page but with help of smooth transition using jquery, which would mimic ipad like page scroll.&lt;br /&gt;
&lt;br /&gt;
Remember to include jquery plugin , jquery mobile plugin and css.&lt;br /&gt;
&lt;br /&gt;
NOTE: The present code and scripts gives only an idea of the development or logic and does not concentrate on great design.and validation&lt;br /&gt;
&lt;br /&gt;
Here is the basic HTML&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;&lt;br /&gt;
&amp;lt;meta content="width=device-width, minimum-scale=1 name="viewport"&amp;gt;&amp;lt;/meta&amp;gt;&lt;br /&gt;
&amp;lt;meta name="apple-mobile-web-app-capable" content="yes" /&amp;gt;&lt;br /&gt;
&amp;lt;meta name="format-detection" content="scroll" /&amp;gt;&lt;br /&gt;
&amp;lt;meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;ipad App - framework&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;link type="text/css" href="css/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;lt;link type="text/css" href="css/ipad.css" rel="stylesheet" /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;lt;script type="text/javascript" src="js/jquery-1.6.2.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type="text/javascript" src="js/jquery-ui-1.8.16.custom.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type="text/javascript" src="js/default.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;div id="p_nm" class="pag"&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;
&amp;lt;div id="wrapper"&amp;gt;&lt;br /&gt;
&amp;lt;div id="page1" class="page"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id="page2" class="page"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id="page3" class="page"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id="page4" class="page"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id="page5" class="page"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;div id="link_index" class="link"&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;a href="#" onclick="scroll_section('page1')"&amp;gt;page1&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;a href="#" onclick="scroll_section('page2')"&amp;gt;page2&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;a href="#" onclick="scroll_section('page3')"&amp;gt;page3&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;a href="#" onclick="scroll_section('page4')"&amp;gt;page4&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;a href="#" onclick="scroll_section('page5')"&amp;gt;page5&amp;lt;/a&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;&lt;br /&gt;
CSS&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
.page{&amp;nbsp; width:720px; height:1000px;margin:5px; border:#CCCCCC solid 1px;&amp;nbsp; }&lt;br /&gt;
@media only screen and (width:device-width) and (orientation:portrait){&lt;br /&gt;
.page{&amp;nbsp; width:720px; height:1000px;margin:5px; border:#CCCCCC solid 1px;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
@media only screen and (width:device-width) and (orientation:landscape){&lt;br /&gt;
.page{&amp;nbsp; width:950px; height:700px;margin:5px; border:#CCCCCC solid 1px; }&lt;br /&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc;"&gt;.pag{ top:0px; width:250px; height:50px; left:45%; position:fixed;}&lt;/span&gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
jQuery&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
function scroll_section(ide)&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
{&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $('#p_nm').html("Page"+ide).animate({top:"15px"},500); // div to show which page u have scrolled into&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $('html,body').animate({scrollTop: $("#"+ide).offset().top},500);&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
thats it!, told you its simple!. :)&lt;br /&gt;
&lt;br /&gt;
subscription and comments are welcome!.&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>simple jquery image gallery script</title><link>http://sreevathsabv.blogspot.com/2012/02/simple-jquery-image-gallary-tutorial.html</link><category>ajax</category><category>image gallery</category><category>image gallery script</category><category>javascript</category><category>jquery</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 16:21:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-5943940570299430906</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
I would walk you through a tutorial on creating a simple , powerful jquery image slider with titles.&lt;br /&gt;
&lt;br /&gt;
Features:&lt;br /&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;Supports any number of images. &lt;/li&gt;
&lt;li&gt;shows animated caption or titles for each image. &lt;/li&gt;
&lt;li&gt;Thumbnail preview with scroll. &lt;/li&gt;
&lt;li&gt;Auto scroll back of thumbnails. &lt;/li&gt;
&lt;li&gt;works fine in many major browsers. &lt;/li&gt;
&lt;li&gt;Easy to code and maintain.  &lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Ok, lets start... &lt;br /&gt;
&lt;br /&gt;
After you include  jQuery file do the following in your index file,create a division named  "capsule" , it will hold our entire slider.Create another division  named "image_viewer" to hold our image viewer and title. Last, create  third division "galleryContainer" that holders our thumbnail images  ,left and right navigation arrows.&lt;br /&gt;
&lt;br /&gt;
NOTE: In order to show captions please write the respective image caption in the respective "title" tag for each image. &lt;br /&gt;
&lt;br /&gt;
complete HTML here:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;div id="capsule"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;  &amp;lt;div id="image_viewer"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;       &amp;lt;!-- To append click images--&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: yellow;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #666666;"&gt;&amp;nbsp;&lt;span style="color: black;"&gt;       &amp;lt;img src="" /&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: yellow;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: #cccccc;"&gt;       &amp;lt;!-- To append image titles--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: yellow;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color: black;"&gt;&amp;nbsp;       &amp;lt;span id="img_title" class="img_title"&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;  &amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;div id="galleryContainer"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;    &amp;lt;div id="arrow_left"&amp;gt;&amp;lt;img src="images/arrow_left.gif"&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;    &amp;lt;div id="arrow_right"&amp;gt;&amp;lt;img src="images/arrow_right.gif"&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;       &amp;lt;div id="innerscroll"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- Thumbnails --&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Blue hills.jpg" title="picture1" class="image"&amp;gt;        &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Sunset.jpg" title="picture2" class="image"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Water lilies.jpg" title="long text caption test with this one" class="image"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Winter.jpg" title="picture 3" class="image"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Blue hills.jpg" title="picture4" class="image"&amp;gt;        &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Sunset.jpg" title="picture5" class="image"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Water lilies.jpg" title="long text caption test with this one" class="image"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;img src="images/Winter.jpg" title="picture 7" class="image"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- Thumbnails end --&amp;gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: yellow;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;       &amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;br /&gt;
Now for the important one, jQuery!&lt;br /&gt;
&lt;br /&gt;
The comments are self explanatory, so am not talking more about it!.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$(document).ready(function() {&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #cccccc;"&gt;
&lt;span style="color: #999999;"&gt;&amp;lt;!-- On page load calculate length of th&lt;/span&gt;umbnail images --&amp;gt;   &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
var x = parseInt ($('#innerscroll img').length)- 2; // remove count for 2 images left and right arrow &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
var count=1; //set counter to calculate image rotation&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- end of variable declaration --&amp;gt;    &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #cccccc;"&gt;
&lt;span style="background-color: #cccccc; color: #999999;"&gt;&amp;lt;!-- On page load show default first image and title &lt;/span&gt;as viewer image --&amp;gt;   &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
var path = $('#innerscroll&amp;gt;img:first').attr('src');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
var caption = $('#innerscroll&amp;gt;img:first').attr('title');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#image_viewer&amp;gt;img').attr('src', path).animate({"easing": "linear",'opacity': "1.0"}, 500).show();&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#image_viewer&amp;gt;span').html("").slideUp('fast');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#image_viewer&amp;gt;span').html(caption).slideDown('slow');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- end of action --&amp;gt;    &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!--  On click of left arrow move thumbnails and animate right arrow with  bright image and dull the current arrow --&amp;gt;       &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; $('#arrow_left').click(function (event){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;         $('#arrow_left img').attr('src','images/arrow_left.gif');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp;         $('#arrow_right img').attr('src','images/arrow_right_over.gif');   &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;         if(count&amp;gt;3){ count=1; $('#innerscroll').animate({left: 0},  500); $('#arrow_right&amp;nbsp; img').attr('src','images/arrow_right.gif');}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;        else {&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#innerscroll').animate({"left": "+=150px",'opacity': "0.5"}, 500).animate({"easing": "easeout",'opacity': "1.0"}, 500); &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
count++;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}       &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
});&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- end of action --&amp;gt;    &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- On click of right arrow move thumbnails and animate left arrow with bright image and dull the current arrow --&amp;gt;   &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#arrow_right').click(function (event){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#arrow_right img').attr('src','images/arrow_right.gif');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#arrow_left img').attr('src','images/arrow_left_over.gif');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
if(x&amp;lt;count){count=1; $('#innerscroll').animate({left: 0}, 500); $('#arrow_left img').attr('src','images/arrow_left.gif'); }&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
else {&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#innerscroll').animate({"left": "-=150px",'opacity': "0.5"}, 500).animate({"easing": "easeout",'opacity': "1.0"}, 500);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
count++; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
});&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- end of action --&amp;gt;    &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- On click of thumbnail load or append the current image and title in the image_viewer division --&amp;gt;   &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$("#innerscroll img").click(function(){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
var path = $(this).attr('src');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
var caption = $(this).attr('title');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#image_viewer&amp;gt;img').attr('src',  path).animate({"easing": "linear",'opacity': "0.5"},  500).animate({"easing": "linear",'opacity': "1.0"}, 500).show();&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#image_viewer&amp;gt;span').html("").slideUp('fast');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$('#image_viewer&amp;gt;span').html(caption).slideDown('slow');&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
});&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: #999999;"&gt;
&amp;lt;!-- end of action --&amp;gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
});&lt;/div&gt;
&lt;br /&gt;
Finally css :&lt;br /&gt;
&lt;br /&gt;
TIP: Make sure your "#image_viewer" and "#image_viewer img" width are same , to get full image view.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;style type="text/css"&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
.scrollable{                                                                                &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
position:relative;width:610px; height:150px; overflow:hidden; margin:5px;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
.image{width:150px; height:100px; float:left; display:block; cursor:pointer; margin:2px;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
.container{ margin:5px; padding:5px; width:690px; background:#fff;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
.container_theater{ margin:5px; padding:5px; width:690px; background:#000000;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
#image_viewer{ &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
border:#000000 solid 5px; width:685px; height:300px;  &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
#image_viewer img{ &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
width:685px; height:300px;   &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
.img_title{ &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
border:#999999  solid 1px; width:100%; height:25px; text-align:center;  margin-top:-25px; float:right; opacity: .8; z-index:15;  background:#CCCCCC;font-family:Verdana; font-style:oblique;  font-weight:800; display:none; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
#arrow_left{position:absolute;float:left;z-index:10;background-color: #FFF;padding:0px;margin-top:2px;cursor:pointer;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
#arrow_right{&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
position:absolute;float:left;right:0px;z-index:10;background-color: #FFF;padding:0px;margin-top:2px;cursor:pointer;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
#innerscroll{position:absolute;height:100px;left:40px;width:10000px;    &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
#galleryContainer{height:102px;    /* Height of the images + 2 */&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
border:1px solid #CCCCCC;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
position:relative;overflow:hidden;padding:0px;width:690px;height: 104px;/* IE 5.x - Added 2 pixels for border left and right */&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
height/* */:/**/102px;    /* Other browsers */                                           &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
height: /**/102px; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
}&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;lt;/style&amp;gt;&lt;/div&gt;
&lt;br /&gt;
Here is how it looks:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://simplejquerycodes.blogspot.com/" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9KoXsEByjV2L93jMDFQ33Bbw0VROP6SxhLq7L7RxXvXfOSwpQzZ0hGAG1vNtLbvISnPG_523w5G9NYgguyUCcA_aQ_YnLOsNE3nuuDRA2bBW9LU8pL3cFY04xF3fVFhGuABxwfWy-_CPj/s400/slider.JPG" height="193" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;
Thats all guys, feedbacks are welcome!&lt;br /&gt;
&lt;br /&gt;
help this blog to grow in anyway you can! :)&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9KoXsEByjV2L93jMDFQ33Bbw0VROP6SxhLq7L7RxXvXfOSwpQzZ0hGAG1vNtLbvISnPG_523w5G9NYgguyUCcA_aQ_YnLOsNE3nuuDRA2bBW9LU8pL3cFY04xF3fVFhGuABxwfWy-_CPj/s72-c/slider.JPG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>how to create a jquery plugin</title><link>http://sreevathsabv.blogspot.com/2012/01/how-to-create-jquery-plugin.html</link><category>jquery</category><category>jquery UI</category><category>plugin creation</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 15:10:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-4961006969051373036</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
As promised , here is how you create a plugin in jQuery. No sweat and blood, relax and follow.. :)&lt;br /&gt;
&lt;br /&gt;
Let us create a simple "circle plugin".&lt;br /&gt;
&lt;br /&gt;
create a div in you index page, this is our div element which animates later as a circle!.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;
&amp;lt;div id="circular" class="_default_circle"&amp;gt;&amp;amp;nbsp;plugin&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;br /&gt;
The important one's,&amp;nbsp; the CSS:&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: yellow;"&gt;
&lt;div style="color: black;"&gt;
._default_circle{ &lt;br /&gt;
width:50px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; height:50px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; background:#00FFFF;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border:#0000FF solid 1px; text-align:center;&lt;/div&gt;
&lt;div style="color: black;"&gt;
}&lt;/div&gt;
&lt;div style="color: black;"&gt;
&lt;/div&gt;
&lt;div style="color: black;"&gt;
._custom_circle{&lt;/div&gt;
&lt;div style="color: black;"&gt;
width:50px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; height:50px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; background:#00FFFF;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border:#0000FF solid 5px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; text-align:center; top:50%;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -webkit-border-radius: 999px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -moz-border-radius: 999px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; border-radius: 999px;&lt;/div&gt;
&lt;div style="color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; behavior: url(PIE.htc);&lt;/div&gt;
&lt;div style="color: black;"&gt;
&lt;/div&gt;
&lt;div style="color: black;"&gt;
}&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
The ._default_circle is used for the div on initial load, the 
._custom_circle is used when you actually access the div through your 
plugin. &lt;br /&gt;
&lt;h1&gt;











&lt;span style="font-size: medium;"&gt;&lt;b&gt;Jquery plugin structure explained!&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;
We can initiate the actual function of plugin using the jQuery built-in structure&lt;br /&gt;
&lt;div style="color: orange;"&gt;
(function($){....... })(jQuery);&lt;/div&gt;
&lt;br /&gt;
Next, make sure that your plugin name is as simple as possible, because ,
 the main advantage of using plugin is to get work done fast, so don't 
let your plugin users think for hours to get the function name right.&lt;br /&gt;
&lt;br /&gt;
Ok , having said that , you can create your plugin function within 
extended JQ function like this, well i am going to call it as &lt;b&gt;circle &lt;/b&gt;itself!, so our first plugin function is circle , so you can call your plugin as &lt;b&gt;$('#divname').circle();&lt;/b&gt; That's it!.. pretty cool ha?&lt;br /&gt;
&lt;br /&gt;
Now, for the creation of function&lt;br /&gt;
&lt;br /&gt;
inside the extended function write something like this&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp; $.fn.circle = function() {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.animate({width : 100, height: 100} ,1000);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.addClass("_custom_circle");&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;
Remember, "this" is already an object, so , its not necessary for you to call $(this) within the function.&lt;br /&gt;
&lt;br /&gt;
ok , here is what we are doing.. we are increasing the width and height 
of the circle along with different css appended to it , also, with an 
animation delay of 1000sec. &lt;br /&gt;
&lt;br /&gt;
Alright,&amp;nbsp; here is the overall jQuery plugin code:&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
$(document).ready(function()&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; //initialize the Jquery plugin&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#circular").circle();&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;});&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
(function($){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; $.fn.circle = function() {&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.animate({width : 100, height: 100} ,1000);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this.addClass("_custom_circle");&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
})(jQuery);&lt;/div&gt;
&lt;br /&gt;
save this script as circle.jquery.js and include in your index page.&lt;br /&gt;
&lt;br /&gt;
That's it!!! comments are welcome!! :)&lt;br /&gt;
&lt;br /&gt;
how it looks:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://simplejquerycodes.blogspot.com/" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5a1AyBr9TJjzz_5tvMc5zDEIYwyUAH9cvKF77atEZeMhQk6RpweecuWwLwaJpGoT9FFe8JxvihUKzEo2bYjUd5AWh0Mjg5WX7gfiQug5RFTLlMgYPCIOcDUlJwtpuZqXiL6bO-MbWBuW7/s640/plug1.jpg" height="160" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://simplejquerycodes.blogspot.com/" target="_blank"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghWgnRgkl02oxsFKSzScGRG91RiiytiCyjKQgXlxHiz4B0LjUWupr1l6EVHoBCK0H1jv7kjofW1RxoJfDSS1A4NCsudvhLqdFEXyJUvhWZqriMvWnOoKJ6vg5YBxWE3d2VUYbgfWh7UyhI/s640/plug2.jpg" height="180" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
Please subscribe for more cool codes :)&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5a1AyBr9TJjzz_5tvMc5zDEIYwyUAH9cvKF77atEZeMhQk6RpweecuWwLwaJpGoT9FFe8JxvihUKzEo2bYjUd5AWh0Mjg5WX7gfiQug5RFTLlMgYPCIOcDUlJwtpuZqXiL6bO-MbWBuW7/s72-c/plug1.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>how to create a jquery plugin with options</title><link>http://sreevathsabv.blogspot.com/2012/01/how-to-create-jquery-plugin-with.html</link><category>jquery</category><category>jquery UI</category><category>plugin creation</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 15:10:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-6096931997232115924</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;span style="font-size: small;"&gt;Hi,&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;In &lt;a href="http://sreevathsabv.blogspot.com/2012/01/how-to-create-jquery-plugin.html" target="_blank"&gt;Part 1&lt;/a&gt;
 of my previous post, i had described on how to build jQuery plugin. In 
this post, i would extend on;&amp;nbsp; and teach you, on how to build the same 
circle plugin with customizable parameters.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;create a div in you index page, this is our div element which animates later as a circle!.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;lt;div id="circular" class="_default_circle"&amp;gt;&amp;amp;nbsp;plugin&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;The important one's,&amp;nbsp; the CSS:&lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;._default_circle{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; width:50px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height:50px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; background:#00FFFF;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; border:#0000FF solid 1px; text-align:center;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;._custom_circle{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;width:50px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height:50px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; background:#00FFFF;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; border:#0000FF solid 5px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; text-align:center; top:50%;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -webkit-border-radius: 999px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -moz-border-radius: 999px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; border-radius: 999px;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; behavior: url(PIE.htc);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;The ._default_circle is used for the div on initial load, the 
._custom_circle is used when you actually access the div through your 
plugin.&lt;/span&gt;&lt;br /&gt;
&lt;h1&gt;







&lt;span style="font-size: small;"&gt;&lt;b&gt;&lt;b&gt;jQuery plugin with options structure explained!&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;span style="font-size: small;"&gt;We can initiate the actual function of plugin using the jQuery built-in structure&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: lime; font-size: small;"&gt;(function($){....... })(jQuery);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;We will use the jQuery "extend" function to have options for the plugin.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;Ok, first we need to decide on how to give options to the plugin, 
because if you provide more options to the user , more likely is he 
going to like your plugin. Also, remember that complexity kills the 
performance, so have a balanced plugin. In this tut, i have three 
options included ; animation speed, height and width of circle. &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;We will initialize the extend function like this&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: lime; font-size: small;"&gt;$.fn.extend({........ }); &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;same way as you would initialize document ready...but, with different syntax.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;call the circle function within the extend function &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: lime; font-size: small;"&gt;circle: function() {... }&lt;/span&gt;&lt;span style="font-size: small;"&gt; , if you are passing default values then use &lt;/span&gt;&lt;span style="color: lime; font-size: small;"&gt;circle: function(options) {... }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;within circle function let us set our default functions like this &lt;/span&gt;&lt;br /&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;var defaults = {&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; anim_speed : 100,&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 100,&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; height : 100,&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;set the default values if the user does not set any in his function call. &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="color: lime; font-size: small;"&gt;var choice = $.extend(defaults, options);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;The $.extend api will merge the contents of two or more objects together into the first object , more info &lt;a href="http://api.jquery.com/jQuery.extend/"&gt;here&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;so for every option we will overwrite the default values in the plugin like this&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 style="background-color: #f4cccc; color: black;"&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;return this.each(function() {&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var curr = $(this);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curr.animate({width : choice.width, height: choice.height} ,choice.anim_speed);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; curr.addClass("_custom_circle");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; });&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;For every option we will animate with default values or with the values user has set.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;A user will call your plugin like this&amp;nbsp; &lt;span style="color: lime;"&gt;$("#circular").circle();&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;In this case , the default variable that you had set earlier will be used in the function.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;Since you have given the options, user can call their plugin with options like this:&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;$("#circular").circle(&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                                    { &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;                                         anim_speed : 1000, &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                                        width : 200, &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                                        height: 200 &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;                                    }   
                                                               &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; color: black;"&gt;
&lt;span style="font-size: small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;             );&lt;/span&gt;&lt;/div&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;&amp;nbsp;Wow congratulation! you did it..&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1&gt;






&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;Here is overall code :&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-size: small;"&gt;$(document).ready(function(){ &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;$("#circular").circle(&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;{ anim_speed : 1000, width : 200, height: 200 } &lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: small;"&gt;});                                                      &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;(function($){ &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;$.fn.extend({&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;circle: function(options) { &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;var defaults = { &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;anim_speed : 100,&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;width: 100,&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;height : 100,&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;}; &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;var choice = $.extend(defaults, options); &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;return this.each(function() { &lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;var curr = $(this);&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;curr.animate({width : choice.width, height: choice.height} ,choice.anim_speed);&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;curr.addClass("_custom_circle");&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;});&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-size: small;"&gt;})(jQuery);&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;Please subscribe for more cool codes :)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;Thank you! any help for the blog is appreciated! :)&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>PHP script to read outlook email inbox</title><link>http://sreevathsabv.blogspot.com/2012/08/php-script-to-read-outlook-email-inbox.html</link><category>ms outlook</category><category>php</category><category>php script</category><category>read email</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 14:30:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-6699559662005309477</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Here is a simple php code to read outlook emails. This code also contains php script to read a outlook inbox mail received from a particular email address. &lt;br /&gt;
&lt;br /&gt;
Please note that the following is achieved through PHP's &lt;a href="http://www.php.net/manual/en/intro.imap.php" target="_blank"&gt;IMAP PROTOCOL.&lt;/a&gt;&lt;br /&gt;
Also, this is not a very secured method of doing it. The idea here is to reveal the concept.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&amp;lt;?php&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); &lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
$incoming_mail_server = 'imap.gmail.com'; //This is an example incoming mail server for gmail which you can configure to your outlook, check out the manual on &lt;a href="http://support.google.com/mail/bin/answer.py?hl=en&amp;amp;ctx=mail&amp;amp;answer=75726" target="_blank"&gt;Supported IMAP client list &lt;/a&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
$your_email = 'me@outlookmail.com'; // your outlook email ID&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
$yourpassword = 'xyz' // your outlook email password&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
$mbox&amp;nbsp;&amp;nbsp; = imap_open("{$incoming_mail_server}", $your_email , $yourpassword )&amp;nbsp;&amp;nbsp; or&amp;nbsp; die("can't connect: " . imap_last_error());&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
$num = imap_num_msg($mbox); // read total messages in email&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
$MC = imap_check($mbox);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
$msg=array();&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
// Fetch an overview for all messages in INBOX&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
$result = imap_fetch_overview($mbox,"$num:{$MC-&amp;gt;Nmsgs}",0);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
foreach ($result as $overview) {&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
echo 'Message no'.$overview-&amp;gt;msgno. '&amp;lt;br/&amp;gt;';&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "{$overview-&amp;gt;subject}&amp;lt;br/&amp;gt;";&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $check = imap_mailboxmsginfo($mbox);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&amp;nbsp;&amp;nbsp; echo $check-&amp;gt;Unread;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $overview-&amp;gt;subject;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $overview-&amp;gt;body;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
//code to check and display email received from a particular Email address&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(preg_match("/xxx@gmail.com/",$overview-&amp;gt;from,$match)){&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $msg[$overview-&amp;gt;msgno]=$overview-&amp;gt;subject;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imap_delete($mbox,$overview-&amp;gt;msgno);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; else{&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imap_delete($mbox,$overview-&amp;gt;msgno);&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; imap_close($mbox);&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="font-family: &amp;quot;georgia&amp;quot; , &amp;quot;times new roman&amp;quot; , serif;"&gt;?&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Subscribe for more cool codes , see the other links below for more codes! &lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Simple script in PHP to drag and drop jQuery UI and store result in MySQL</title><link>http://sreevathsabv.blogspot.com/2012/03/simple-script-in-php-to-drag-and-drop.html</link><category>ajax</category><category>drag and drop</category><category>jquery</category><category>jquery UI</category><category>mysql</category><category>php</category><category>php script</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 13:37:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-4348929018187950937</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Simple script to drag and drop jQuery UI and store result in MySQL using PHP. &lt;br /&gt;
&lt;br /&gt;
Hello their !&lt;br /&gt;
&lt;br /&gt;
I was thinking, how much would drag and drop UI of jQuery help the people in pure designing aspect?, well... found out - not much!, until you use it with powerful scripting language, whats better then PHP ?.&lt;br /&gt;
Secondly, i thought if you can use PHP why not database to store it?. Behold!! here is the simple script to drag and drop the UI and store result in MySQL along with the help of PHP.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Include &lt;a href="http://docs.jquery.com/Downloading_jQuery" target="_blank"&gt;jquery&lt;/a&gt; library&lt;br /&gt;
Include &lt;a href="http://jqueryui.com/download" target="_blank"&gt;jquery UI widget&lt;/a&gt; library, especially &lt;b&gt;interactions&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Before i start , i would recommend you to learn this basic &lt;a href="http://jqueryui.com/demos/draggable/" target="_blank"&gt;Drag &amp;amp; drop tutorial&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Basic CSS to style our drag and drop UI&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
.content_box{ padding:5px; &lt;br /&gt;
&amp;nbsp;width:300px; &lt;br /&gt;
&amp;nbsp; float:left;height:250px; &lt;br /&gt;
&amp;nbsp;border:#00FFFF solid 1px; &lt;br /&gt;
&amp;nbsp;font-family:Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt;
margin:10px;&lt;br /&gt;
overflow:auto;&lt;br /&gt;
color:#999999;&lt;br /&gt;
font-size:14px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.content_holder_box{ width:300px;&lt;br /&gt;
float:right;&lt;br /&gt;
height: 250px;&lt;br /&gt;
border:#0099FF solid 1px;&lt;br /&gt;
padding:10px;&lt;br /&gt;
margin:10px;&lt;br /&gt;
color:#999999;&lt;br /&gt;
font-size:14px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.content_holder_box:hover{ border:#0099FF solid 1px; }&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
.dragelement{ padding:5px; margin:3px; width:270px; &lt;br /&gt;
border:#99FF66 solid 1px;&lt;br /&gt;
background-color:#E2FFC6;&lt;br /&gt;
cursor:move;&lt;br /&gt;
color:#000;&lt;br /&gt;
font-size:13px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.dropper{ width:270px;&lt;br /&gt;
height:125px;&lt;br /&gt;
margin:10px;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.dropper_hover{ border:#999999 dashed 1px; background:url(../images/darrow.jpg) center no-repeat&amp;nbsp; ;}&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc; color: #666666;"&gt;//you can show arrow image to suggest where user has to drop selected UI.&lt;/span&gt;&lt;span style="color: #666666;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;Create index.php and write a simple drag environment , i have created a static one, you can create a dynamic drag environment, for example shopping cart elements from database.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;lt;div class="content_box" id="content_box_drag" onMouseOver="drag();"&amp;gt; Drag label&lt;br /&gt;
&amp;lt;?php&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;
for($i=0; $i&amp;lt;5;$i++)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;lt;p class='dragelement' id='dragelement_$i'&amp;gt;Ferrari_$i&amp;lt;/p&amp;gt;";&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;
&amp;lt;div class="content_holder_box" id="content_box_drop"&amp;gt;Drop here&lt;br /&gt;
&amp;lt;p class="dropper"&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;
&amp;lt;div style="clear:both;"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;div id="search_result"&amp;gt;&amp;lt;/div&amp;gt; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style="text-align: left;"&gt;
&lt;li&gt;id "content_box_drag" is a static draggable environment.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;initialize drag() function on mouse hover , to prepare the drag UI.&lt;/li&gt;
&lt;li&gt;create few drag elements from php (static).&lt;/li&gt;
&lt;li&gt;create a drop box "content_box_drop" , so that users can drop the dragged element into it for selection.&lt;/li&gt;
&lt;li&gt;create a &amp;lt;p&amp;gt; tag so that we can append the drag element to it.&amp;nbsp; (you can use any!)&lt;/li&gt;
&lt;li&gt;use a div to show the result , here "search_result". &lt;/li&gt;
&lt;/ul&gt;
javascript to create a drag function and produce the result&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
//initialize the drag and drop functions.&lt;br /&gt;
function drag(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $( "#content_box_drag p" ).draggable({&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; appendTo: "body",&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; helper: "clone",&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; revert: "invalid"&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //add comma to previous last line &amp;amp; uncomment this if u want to remove the dropped item&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/*stop: function(){$(this).remove();}*/ &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $( "#content_box_drop p" ).droppable({&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; activeClass: "dropper_hover",&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; hoverClass: "dropper_hover",&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; accept: ":not(.ui-sortable-helper)",&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; drop: function( event, ui ) {&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var ele = ui.draggable.text(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "store.php",&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type : "POST", &lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: {element:ele},&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; beforeSend:function(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; $('#search_result').html("&amp;lt;center&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;h4&amp;gt;Loading.....&amp;lt;/h4&amp;gt;&amp;lt;/center&amp;gt;");&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; },&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; success:function(data){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $("#search_result").html(data);&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;
&lt;br /&gt;
}&lt;/div&gt;
&lt;br /&gt;
Now create a page store.php and write the following to store the value&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$con = mysql_connect("localhost","asc","abc123"); &lt;br /&gt;
if (!$con)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;die('Could not connect: ' . mysql_error());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&amp;nbsp;mysql_select_db( 'shop' );&amp;nbsp;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
$element = $_POST['element'];&lt;br /&gt;
&lt;br /&gt;
$query = mysql_query("insert into cart values ('',$element)");&lt;br /&gt;
echo "$element is added";&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #f4cccc;"&gt;
&lt;span style="background-color: #f4cccc;"&gt;mysql_close($con);&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&amp;nbsp; &lt;br /&gt;
Please note that the idea of this tutorial is to show you how to create things in a simple and understandable way. It does not focus on security and authenticity etc..&lt;br /&gt;
&lt;br /&gt;
Check out the other cool code links :)&lt;br /&gt;
&lt;br /&gt;
Hope it was helpful , as it was for me.Subscription and Comments are appreciated!!&lt;br /&gt;
&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="background-color: #f4cccc;"&gt;&lt;/span&gt;&lt;b&gt;Demo look&lt;/b&gt;::&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI-X71oiSV_cNveuaAnD3gg79WZ865510Ec8xwDA0TgT5yq4j5Vpp8t7wHpMcbdU8-bIVK2NmzIooP72h_hbozcjLw2lOJx6TxxgGLgIInJEg88R-WPBUO6ED2ZDBCtwlCx0Jsbk8az-rw/s640/draagdrop.JPG" height="252" style="margin-left: auto; margin-right: auto;" width="640" /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;jQuery php mysql - drag and drop demo&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI-X71oiSV_cNveuaAnD3gg79WZ865510Ec8xwDA0TgT5yq4j5Vpp8t7wHpMcbdU8-bIVK2NmzIooP72h_hbozcjLw2lOJx6TxxgGLgIInJEg88R-WPBUO6ED2ZDBCtwlCx0Jsbk8az-rw/s72-c/draagdrop.JPG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">22</thr:total></item><item><title>simple tooltip in Jquery</title><link>http://sreevathsabv.blogspot.com/2011/06/tooltip-in-jquery.html</link><category>javascript</category><category>jquery</category><category>tooltip</category><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 12 Oct 2013 12:39:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-2452097065322807045</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
In this post, i have attempted to create my own jquery code to show the tooltip on mouseover event.&lt;br /&gt;
The coding goes like this:&lt;br /&gt;
&lt;br /&gt;
CREATE A DIV ELEMENT:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;lt;div class="tooltip" id="toolt" style="display: none;"&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;
&lt;br /&gt;
create a div element and name the ID as "toolt"(not necessarily same name)and initially hide the division by giving &lt;b&gt;style="display:none;"&lt;/b&gt; option&lt;br /&gt;
&lt;br /&gt;
CSS FOR THE ELEMENT:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
.tooltip{&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; border:1px dashed #0000FF;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; padding-left:10px; &lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; padding:5px; &lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; width:100px; &lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; background-color:#CCFFFF; &lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; position:absolute; &lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; opacity:0.9;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; font-family:Geneva;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; font-weight:bold;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; -moz-box-shadow: 0 0 13px #888;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; -webkit-box-shadow: 0 0 13px #888;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; box-shadow: 0 0 13px #888;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; -moz-border-radius:3px; &lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
}&lt;/div&gt;
&lt;br /&gt;
Note that i have called the css through .tooltip class in the division which is supposed to be used for tooltip on hover.&lt;br /&gt;
Also, note that i have cracked the mozilla firefox to create round edge effect .Also, i would give a different design in IE.&lt;br /&gt;
&lt;br /&gt;
JQUERY TO SHOW TOOLTIP:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
function show(id,txt){&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; $(id).mouseover(function(e){&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; var offsetsLeft = $(window).scrollLeft();&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; var offsetsTop = $(window).scrollTop();&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; leftpos = parseInt(offsetsLeft + (e.pageX)) + 'px';&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; toppos = parseFloat(offsetsTop + (e.pageY)) + 'px';&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; $('#toolt').css({'top':toppos,'left':leftpos});&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; document.getElementById("toolt").innerHTML=txt;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; $('#toolt').show();&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
});&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
$(id).mouseout(function(e){&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; $('#toolt').hide();&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
&amp;nbsp; &amp;nbsp; e.stopPropagation();&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
});&lt;/div&gt;
&lt;div style="background-color: #cccccc; color: black;"&gt;
}&lt;/div&gt;
&lt;br /&gt;
First  , we need to pass the parameter to the function "show()"(see below to  see how it is initialized), the first parameter should be DOM object  type like a,p,span,div etc; the second parameter should be the content  that will be displayed in the tooltip.&lt;br /&gt;
Next we shall calculate the  mousepointer coordinates and call the tooltip division on that  particular division.The first part of the function will do that trick. &lt;br /&gt;
Later, when mouse is taken off we will hide that division again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INITIALIZING THE TOOLTIP:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: yellow;"&gt;
&lt;a href="http://www.blogger.com/blogger.g?blogID=4939827838751757570"&gt;&amp;lt;a href="javascript:void(0);" onmouseover="show('p','This is a tooltip content')"&amp;gt;Hover Here&amp;lt;/a&amp;gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
If  you need to call a tooltip for the 'p' tag, then you can use the above  method to initialize the tooltip. Dont forget to pass the DOM object in  the first parameter and remember your DOM object will be your first  parameter.&lt;br /&gt;
&lt;br /&gt;
Thats it guys, feedback's are welcome! :)&lt;/div&gt;
&lt;script type="text/javascript"&gt;
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15619949-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
&lt;/script&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Programming in PHP JQuery</title><link>http://sreevathsabv.blogspot.com/2011/06/programming-in-php-jquery.html</link><author>noreply@blogger.com (Unknown)</author><pubDate>Tue, 19 Mar 2013 14:59:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-7031077336999093712</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
If you are looking something to do like Facebook popup or message box using jQuery and PHP, you have come to the right place.&lt;br /&gt;
I have tried my own script to do so and you can check that out here.....&lt;br /&gt;
&lt;b&gt;&lt;a href="http://sreevathsabv.blogspot.com/p/facebook-like-popup-box-message-box-in_13.html"&gt;Facebook like popup script&lt;/a&gt;&lt;/b&gt;.&lt;/div&gt;
&lt;script type="text/javascript"&gt;
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-15619949-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
&lt;/script&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Announcement to subscribers</title><link>http://sreevathsabv.blogspot.com/2012/09/announcement-to-subscribers.html</link><author>noreply@blogger.com (Unknown)</author><pubDate>Sat, 22 Sep 2012 16:51:00 +0530</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-4939827838751757570.post-8122707077655894422</guid><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Hi friends,&lt;br /&gt;
&lt;br /&gt;
Thank you for your support and subscription.&lt;br /&gt;
&lt;br /&gt;
I had to change the feed&amp;nbsp;URL&amp;nbsp;for some reasons, Therefore , please subscribe again and do continue your support.&lt;br /&gt;
&lt;br /&gt;
I apologize again for the&amp;nbsp;inconvenience.&lt;br /&gt;
&lt;br /&gt;
have a great coding season!. bye :)&amp;nbsp;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;Education is the manifestation of divinity already in men!.- Swami Vivekananda&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>