<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySandbox &#187; jquery</title>
	<atom:link href="http://sandbox.ronggur.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://sandbox.ronggur.com</link>
	<description>Ronggur Hutasuhut Playground</description>
	<lastBuildDate>Thu, 15 Apr 2010 08:53:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>jQuery Tutorial : Simple ajax star rating with php (extended)</title>
		<link>http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/</link>
		<comments>http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:32:41 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[featured]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=186</guid>
		<description><![CDATA[Some people ask me question about how to implement my last star rating in multiple star rating, and here is the answer on how to implement it.
1. Upgrade latest table
Since you&#8217;ll need to add &#8216;id&#8217; on multiple record then we need to upgrade the existing table. Here is the full sql

CREATE TABLE IF NOT EXISTS [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Some people ask me question about how to implement my <a title="simple ajax star rating with php" href="http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php">last star rating</a> in multiple star rating, and here is the answer on how to implement it.</p>
<h3>1. Upgrade latest table</h3>
<p>Since you&#8217;ll need to add &#8216;id&#8217; on multiple record then we need to upgrade the existing table. Here is the full sql</p>
<pre class="brush: sql;">
CREATE TABLE IF NOT EXISTS `vote` (
 `id` int(11) NOT NULL auto_increment,
 `desc` varchar(50) NOT NULL,
 `counter` int(8) NOT NULL default '0',
 `value` int(8) NOT NULL default '0',
 PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `vote`
--

INSERT INTO `vote` (`id`, `desc`, `counter`, `value`) VALUES
(1, 'star - 1', 0, 0),
(2, 'star - 2', 0,0);
</pre>
<h3>2. CSS</h3>
<p>We still can stylesheet from the previous post. No need to modify it.</p>
<p><span id="more-186"></span></p>
<h3>3. PHP files (index.php &amp; update.php)</h3>
<p>There are some code changes in this files. If in previous post we just need an html file to represent the star rating, now we need php file to do it. Here is full code for <em>index.php</em> and some simple code explanation in it</p>
<pre class="brush: php;">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;jQuery Tutorial : Simple ajax star rating&lt;/title&gt;
&lt;meta name=&quot;Keywords&quot; content=&quot;Star rating, jQuery, ajax&quot;&gt;
&lt;meta name=&quot;Description&quot; content=&quot;jQuery Tutorial : Simple ajax star rating&quot;&gt;
&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;en&quot;&gt;
&lt;meta name=&quot;robots&quot; content=&quot;index,follow&quot;&gt;
&lt;script src=&quot;rating/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;rating/starrating.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;rating/starrating.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
// include update.php
include_once 'update.php';
// get all data from tabel
$arr_star = fetchStar();
?&gt;
&lt;?php
// start looping datas
foreach($arr_star as $star){ ?&gt;
&lt;h2&gt;Star Rater - &lt;?php echo $star['id'];?&gt;&lt;/h2&gt;
&lt;ul class='star-rating' id=&quot;star-rating-&lt;?php echo $star['id'];?&gt;&quot;&gt;
&lt;?php /* getRating($id) is to generate current rating */?&gt;
 &lt;li id=&quot;current-rating-&lt;?php echo $star['id'];?&gt;&quot; style=&quot;width:&lt;?php echo getRating($star['id'])?&gt;%&quot;&gt;&lt;!-- will show current rating --&gt;&lt;/li&gt;
 &lt;?php
 /* we need to generate 'id' for star rating.. this 'id' will identify which data to execute  */
 /* we will pass it in ajax later */
 ?&gt;
 &lt;span id=&quot;&lt;?php echo $star['id'];?&gt;&quot;&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;1 star out of 5&quot;&gt;1&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;2 stars out of 5&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;3 stars out of 5&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;4 stars out of 5&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
 &lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;5 stars out of 5&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
 &lt;/span&gt;
&lt;/ul&gt;
&lt;?php } ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>And this is for <em>update.php</em></p>
<pre class="brush: php;">
&lt;?php
// connect to database
$dbh=mysql_connect (&quot;localhost&quot;, &quot;user&quot;, &quot;password&quot;) or die ('Cannot connect to the database');
mysql_select_db (&quot;database&quot;,$dbh);

if($_GET['do']=='rate'){
 // do rate and get id
 rate($_GET['id']);
}else if($_GET['do']=='getrate'){
 // get rating and get id
 getRating($_GET['id']);
}

// get data from tabel
function fetchStar(){
 $sql = &quot;select * from `vote`&quot;;
 $result=@mysql_query($sql);
 while($rs = @mysql_fetch_array($result,MYSQL_ASSOC)){
 $arr_data[] = $rs;
 }
 return $arr_data;
}

// function to retrieve
function getRating($id){
 $sql= &quot;select * from vote`` where id='&quot;.$id.&quot;' &quot;;
 $result=@mysql_query($sql);
 $rs=@mysql_fetch_array($result);
 // set width of star
 $rating = (@round($rs[value] / $rs[counter],1)) * 20;
 echo $rating;
}

// function to insert rating
function rate($id){
 $text = strip_tags($_GET['rating']);
 $update = &quot;update `vote` set counter = counter + 1, value = value + &quot;.$_GET['rating'].&quot;  where id='&quot;.$id.&quot;' &quot;;

 $result = @mysql_query($update);
}
?&gt;
</pre>
<h3>4. Javascript</h3>
<pre class="brush: jscript;">
// JavaScript Document
 $(document).ready(function() {
 // get rating function
 function getRating(id){
 $.ajax({
 type: &quot;GET&quot;,
 url: &quot;update.php&quot;,
 data: &quot;do=getrate&amp;id=&quot;+id,
 cache: false,
 async: false,
 success: function(result) {
 // apply star rating to element
 $(&quot;#current-rating-&quot;+id+&quot;&quot;).css({ width: &quot;&quot; + result + &quot;%&quot; });
 },
 error: function(result) {
 alert(&quot;some error occured, please try again later&quot;);
 }
 });
 }

 // link handler
 $('.ratelinks li a').click(function(){
 // get the parent id
 var idStar = $(this).parent().parent().attr('id');
 $.ajax({
 type: &quot;GET&quot;,
 url: &quot;update.php&quot;,
 data: &quot;rating=&quot;+$(this).text()+&quot;&amp;do=rate&amp;id=&quot;+idStar,
 cache: false,
 async: false,
 success: function(result) {
 // remove #ratelinks element to prevent another rate
 $(&quot;#ratelinks&quot;).remove();
 // get rating after click
 getRating(idStar);
 },
 error: function(result) {
 alert(&quot;some error occured, please try again later&quot;);
 }
 });

 });
 });
</pre>
<p>That&#8217;s it! hope it works for you <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . You can add some modification like notification, or loader while processing.</p>
<p>- <a title="Simple star rating" href="http://dock.ronggur.com/tutorial/jquery_tutorial_starrating_extended/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/jquery_tutorial_starrating_extended/?referer=');">View Demo</a></p>
<p>- Download zip file <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=8" title=" downloaded 309 times" >jQuery Tutorial : Simple ajax star rating with php (extended) (309)</a></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for jQuery Tutorial : Simple ajax star rating with php (extended)" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+:+Simple+ajax+star+rating+with+php+(extended)" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+_+Simple+ajax+star+rating+with+php+_extended&amp;referer=');">You can give me some coffee if you want to :D</a></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="pageTracker._trackPageview('/outgoing/blinklist.com/index.php?Action=Blink/addblink.php_amp_Name=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29_amp_Description=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29_amp_Url=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Name=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29&amp;Description=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29&amp;Url=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F" rel="nofollow" title="Add to&nbsp;BlinkList"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/blinklist.png" title="Add to&nbsp;BlinkList" alt="Add to&nbsp;BlinkList" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.bloglines.com/sub/http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F?referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.bloglines.com/sub/http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F" rel="nofollow" title="Add to&nbsp;Bloglines"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/bloglines.png" title="Add to&nbsp;Bloglines" alt="Add to&nbsp;Bloglines" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/del.icio.us/post?url=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/digg.com/submit?phase=2_amp_url=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.facebook.com/sharer.php?u=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.google.com/bookmarks/mark?op=edit_amp_output=popup_amp_bkmk=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.stumbleupon.com/submit?url=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.technorati.com/faves?add=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/myweb2.search.yahoo.com/myresults/bookmarklet?u=http_3A_2F_2Fsandbox.ronggur.com_2F2010_2F01_2F19_2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended_2F_amp_t=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php+_28extended_29&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsandbox.ronggur.com%2F2010%2F01%2F19%2Fjquery-tutorial-simple-ajax-star-rating-with-php-extended%2F&amp;t=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php+%28extended%29" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Google Maps : Pointing and get your marker location</title>
		<link>http://sandbox.ronggur.com/2009/08/01/google-maps-pointing-and-get-your-marker-location/</link>
		<comments>http://sandbox.ronggur.com/2009/08/01/google-maps-pointing-and-get-your-marker-location/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 11:13:44 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=102</guid>
		<description><![CDATA[ In this post i want to try give some simple script to get your marker location in google maps. Next we will ceate one marker and when you  drag and drop it, you'll get the position of the marker ( latitude and langitude ). You can use this kind of script if you want to add google maps feature in to your websites and want to point position and save it in to your database



Related posts:<ol><li><a href='http://sandbox.ronggur.com/2009/11/26/new-google-searc-interface/' rel='bookmark' title='Permanent Link: New Google search interface'>New Google search interface</a> <small>Have you tried the new google search intrerface? here i...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In this post i want to try give some simple script to get your marker location in google maps. Next we will ceate one marker and when you  drag and drop it, you&#8217;ll get the position of the marker ( latitude and langitude ). You can use this kind of script if you want to add google maps feature in to your websites and want to point position and save it in to your database</p>
<div id="attachment_111" class="wp-caption aligncenter" style="width: 310px"><a href="http://sandbox.ronggur.com/wp-content/uploads/2009/08/image.jpg"><img class="size-medium wp-image-111" title="image" src="http://sandbox.ronggur.com/wp-content/uploads/2009/08/image-300x141.jpg" alt="Image Preview" width="300" height="141" /></a><p class="wp-caption-text">Image Preview</p></div>
<p>As usual we&#8217;ll use  jQuery to give some little help. Lets start</p>
<h4 style="text-align: left;"><strong>1. HTML &amp; PHP files</strong></h4>
<p>You can copy html below. Make sure you already have key for your google maps and use your own key <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . And also don&#8217;t forget to include <a title="jquery" href="http://jquery.com" onclick="pageTracker._trackPageview('/outgoing/jquery.com?referer=');">jQuery</a> library.</p>
<p>To get the current position of the marker, we will use hidden intput to store the position temporary before we post it to php file.</p>
<pre class="brush: xml;">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;Google Map in Learning&lt;/title&gt;
&lt;link href=&quot;styles/style.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;script src=&quot;js/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;v=2&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;sensor=false&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;key=ABQIAAAAYeuJd8iDXzlrlsewUFBcLhQCLRJBQIjl4T4yd7P58JjfH0ny1BRyKA-JaUsGkxqxnC7LUYx0xI7rAQ&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/addmarker.js&quot;  type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrapper_map&quot;&gt;
&lt;div id=&quot;map_canvas&quot; style=&quot;width: 640px; height: 300px&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;wrapper_form&quot;&gt;
&lt;p&gt;&lt;strong&gt;Your Location : &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Latitude : &lt;span id=&quot;sLat&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Longitude : &lt;span id=&quot;sLng&quot;&gt;&lt;/span&gt;&lt;/p&gt;
&lt;form name=&quot;fLocation&quot; id=&quot;fLocation&quot; method=&quot;post&quot; action=&quot;post.php&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;lat&quot; id=&quot;lat&quot; value=&quot;&quot; /&gt;
&lt;input type=&quot;hidden&quot; name=&quot;lng&quot; id=&quot;lng&quot; value=&quot;&quot; /&gt;
&lt;input type=&quot;submit&quot; value=&quot;Save&quot; /&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Next is one line php script and named it &#8216;post.php&#8217;, this script just to show that your post data from html is work.</p>
<pre class="brush: php;">

var_dump($_POST);
</pre>
<p><span id="more-102"></span></p>
<h4 style="text-align: left;"><strong>2. JavaScript</strong></h4>
<p>Lets create addmarker.js. Here is the code, i put some comment above the line</p>
<pre class="brush: jscript;">

$(document).ready(function() {
$(&quot;#wrapper_map&quot;).width($(&quot;#map_canvas&quot;).width());
// initialize default lat &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp; lang in this case i set to Indonesia

var indLat = -2;
var indLng = 120;

// setup default position into text and hidden input

$(&quot;#sLat&quot;).text(indLat);
$(&quot;#sLng&quot;).text(indLng);
$(&quot;#lat&quot;).val(indLat);
$(&quot;#lng&quot;).val(indLng);

// start setup google maps

var map = new GMap2(document.getElementById(&quot;map_canvas&quot;));
var center = new GLatLng(indLat, indLng);
map.setCenter(center, 4);
map.setUIToDefault();

var marker = new GMarker(center, { draggable: true });

GEvent.addListener(marker, &quot;dragstart&quot;, function() {
map.closeInfoWindow();
});

// a listener to get current position and store it to hidden input in html

GEvent.addListener(marker, &quot;dragend&quot;, function() {
// latitude
$(&quot;#sLat&quot;).text(roundNumber(getObjectLoc(marker, 'lat'), 5));
// store it temporary in hidden input (lat)
$(&quot;#lat&quot;).val(getObjectLoc(marker, 'lat'));
// longitude
$(&quot;#sLng&quot;).text(roundNumber(getObjectLoc(marker, 'lang'), 5));
// store it temporary in hidden input (lng)
$(&quot;#lng&quot;).val(getObjectLoc(marker, 'lang'));
});

// adding marker
map.addOverlay(marker);
// end setup google maps

// fungction to get the marker posistion

getObjectLoc = function(object, type){
var objectLoc = '';
if(type=='lat'){
objectLoc = object.getLatLng().lat();
}else{
objectLoc = object.getLatLng().lng();
}

return objectLoc;
}

// just round your position if you think it is too long to show

roundNumber = function(rnum, rlength) {
newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
return newnumber;
}
});
</pre>
<p>That&#8217;s all. So when you press &#8216;Save&#8217; button it should print out your current marker position.</p>
<p><strong>- <a title="Simple star rating" href="http://dock.ronggur.com/tutorial/pointingmarker/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/pointingmarker/?referer=');">View Demo</a></strong></p>
<p><strong>- Download file <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=6" title=" downloaded 100 times" >Google Maps : Pointing and get your marker location (100)</a></strong></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for Google Maps : Pointing and get your marker location" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+Google+Maps+:+Pointing+and+get+your+marker+location" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+Google+Maps+_+Pointing+and+get+your+marker+location&amp;referer=');">You can give me some coffee if you want to :D</a></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="pageTracker._trackPageview('/outgoing/blinklist.com/index.php?Action=Blink/addblink.php_amp_Name=Google+Maps+_3A+Pointing+and+get+your+marker+location_amp_Description=Google+Maps+_3A+Pointing+and+get+your+marker+location_amp_Url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Name=Google+Maps+%3A+Pointing+and+get+your+marker+location&amp;Description=Google+Maps+%3A+Pointing+and+get+your+marker+location&amp;Url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F" rel="nofollow" title="Add to&nbsp;BlinkList"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/blinklist.png" title="Add to&nbsp;BlinkList" alt="Add to&nbsp;BlinkList" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.bloglines.com/sub/http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F?referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.bloglines.com/sub/http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F" rel="nofollow" title="Add to&nbsp;Bloglines"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/bloglines.png" title="Add to&nbsp;Bloglines" alt="Add to&nbsp;Bloglines" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/del.icio.us/post?url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F_amp_title=Google+Maps+_3A+Pointing+and+get+your+marker+location&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F&amp;title=Google+Maps+%3A+Pointing+and+get+your+marker+location" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/digg.com/submit?phase=2_amp_url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F_amp_title=Google+Maps+_3A+Pointing+and+get+your+marker+location&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F&amp;title=Google+Maps+%3A+Pointing+and+get+your+marker+location" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.facebook.com/sharer.php?u=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.google.com/bookmarks/mark?op=edit_amp_output=popup_amp_bkmk=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F_amp_title=Google+Maps+_3A+Pointing+and+get+your+marker+location&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F&amp;title=Google+Maps+%3A+Pointing+and+get+your+marker+location" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.stumbleupon.com/submit?url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F_amp_title=Google+Maps+_3A+Pointing+and+get+your+marker+location&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F&amp;title=Google+Maps+%3A+Pointing+and+get+your+marker+location" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.technorati.com/faves?add=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/myweb2.search.yahoo.com/myresults/bookmarklet?u=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F08_2F01_2Fgoogle-maps-pointing-and-get-your-marker-location_2F_amp_t=Google+Maps+_3A+Pointing+and+get+your+marker+location&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F08%2F01%2Fgoogle-maps-pointing-and-get-your-marker-location%2F&amp;t=Google+Maps+%3A+Pointing+and+get+your+marker+location" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://sandbox.ronggur.com/2009/11/26/new-google-searc-interface/' rel='bookmark' title='Permanent Link: New Google search interface'>New Google search interface</a> <small>Have you tried the new google search intrerface? here i...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/08/01/google-maps-pointing-and-get-your-marker-location/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Tutorial : Simple ajax star rating with php</title>
		<link>http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php/</link>
		<comments>http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php/#comments</comments>
		<pubDate>Sat, 30 May 2009 03:08:11 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=75</guid>
		<description><![CDATA[I made this simple ajax star rating for my latest poject. And now i want to share it to you. Let&#8217;s start it  .
Step 1 : CSS Star Rater
First thing is the star rater. I got this cool  &#8216;css star rater&#8217; from http://www.komodomedia.com/ . I assumed that we already understood how to use [...]


Related posts:<ol><li><a href='http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/' rel='bookmark' title='Permanent Link: jQuery Tutorial : Simple ajax star rating with php (extended)'>jQuery Tutorial : Simple ajax star rating with php (extended)</a> <small>Some people ask me question about how to implement my...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I made this simple ajax star rating for my latest poject. And now i want to share it to you. Let&#8217;s start it <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p><strong>Step 1 : </strong><strong>CSS Star Rater</strong></p>
<p>First thing is the star rater. I got this cool  &#8216;css star rater&#8217; from <a title="komodomedia.com" href="http://www.komodomedia.com/blog/2007/01/css-star-rating-redux/" onclick="pageTracker._trackPageview('/outgoing/www.komodomedia.com/blog/2007/01/css-star-rating-redux/?referer=');">http://www.komodomedia.com/</a> . I assumed that we already understood how to use it, so we will not talk too much about this &#8216;css star rater&#8217;.</p>
<p><strong>Step 2 : </strong><strong>Create MySQL table<br />
</strong></p>
<p>Next is create table (using MySQL) to store the data. You can copy the script below</p>
<pre class="brush: sql;">

CREATE TABLE IF NOT EXISTS `vote` (
`counter` int(8) NOT NULL default '0',
`value` int(8) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
</pre>
<p><strong>Step 3 : </strong><strong>PHP</strong></p>
<p>After finished create table, then we can start create some php code to handle input, update and retrieve data from the database, here is the code. I added some important comment in it</p>
<p><span id="more-75"></span></p>
<pre class="brush: php;">

&lt;?php

// connect to database
$dbh=mysql_connect (&quot;localhost&quot;, &quot;username&quot;, &quot;password&quot;) or die ('Cant connect to the database');
mysql_select_db (&quot;rating&quot;,$dbh);

if($_GET['do']=='rate'){
// do rate
rate();
}else if($_GET['do']=='getrate'){
// get rating
getRating();
}

// function to retrieve
function getRating(){
$sql= &quot;select * from vote&quot;;
$result=@mysql_query($sql);
$rs=@mysql_fetch_array($result);
// set width of star
$rating = (@round($rs[value] / $rs[counter],1)) * 20;
echo $rating;
}

// function to insert rating
function rate(){
$text = strip_tags($_GET['rating']);
$update = &quot;update vote set counter = counter + 1, value = value + &quot;.$_GET['rating'].&quot;&quot;;

$result = @mysql_query($update);
if(@mysql_affected_rows() == 0){
$insert = &quot;insert into vote (counter,value) values ('1','&quot;.$_GET['rating'].&quot;')&quot;;
$result = @mysql_query($insert);
}
}

?&gt;
</pre>
<p><strong>Step 4 : </strong><strong>JavaScript</strong></p>
<p>Next thing is javascript code. Below is the code, you can put this code between &lt;head&gt; tag or put it in separated javascript file.</p>
<pre class="brush: jscript;">

&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function() {
// get current rating
getRating();
// get rating function
function getRating(){
$.ajax({
type: &quot;GET&quot;,
url: &quot;update.php&quot;,
data: &quot;do=getrate&quot;,
cache: false,
async: false,
success: function(result) {
// apply star rating to element
$(&quot;#current-rating&quot;).css({ width: &quot;&quot; + result + &quot;%&quot; });
},
error: function(result) {
alert(&quot;some error occured, please try again later&quot;);
}
});
}

// link handler
$('#ratelinks li a').click(function(){
$.ajax({
type: &quot;GET&quot;,
url: &quot;update.php&quot;,
data: &quot;rating=&quot;+$(this).text()+&quot;&amp;amp;amp;do=rate&quot;,
cache: false,
async: false,
success: function(result) {
// remove #ratelinks element to prevent another rate
$(&quot;#ratelinks&quot;).remove();
// get rating after click
getRating();
},
error: function(result) {
alert(&quot;some error occured, please try again later&quot;);
}
});
});
});
&lt;/script&gt;
</pre>
<p>Don&#8217;t forget to link the jquery library into your document</p>
<pre class="brush: jscript;">

&lt;script src=&quot;rating/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
</pre>
<p><strong>Step 5 : Put it all together</strong></p>
<p>Put your css, javascript in one html</p>
<pre class="brush: xml;">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;jQuery Tutorial : Simple ajax star rating&lt;/title&gt;
&lt;meta name=&quot;Keywords&quot; content=&quot;Star rating, jQuery, ajax&quot;&gt;
&lt;meta name=&quot;Description&quot; content=&quot;jQuery Tutorial : Simple ajax star rating&quot;&gt;
&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;en&quot;&gt;
&lt;meta name=&quot;robots&quot; content=&quot;index,follow&quot;&gt;
&lt;style&gt;
body{
font:12px Arial, Helvetica, sans-serif;
padding:40px;
}
&lt;/style&gt;
&lt;script src=&quot;rating/jquery.min.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;rating/starrating.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;rating/starrating.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;Star Rater&lt;/h2&gt;
&lt;ul class='star-rating'&gt;
&lt;li class=&quot;current-rating&quot; id=&quot;current-rating&quot;&gt;&lt;!-- will show current rating --&gt;&lt;/li&gt;
&lt;span id=&quot;ratelinks&quot;&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;1 star out of 5&quot; class=&quot;one-star&quot;&gt;1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;2 stars out of 5&quot; class=&quot;two-stars&quot;&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;3 stars out of 5&quot; class=&quot;three-stars&quot;&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;4 stars out of 5&quot; class=&quot;four-stars&quot;&gt;4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;javascript:void(0)&quot; title=&quot;5 stars out of 5&quot; class=&quot;five-stars&quot;&gt;5&lt;/a&gt;&lt;/li&gt;
&lt;/span&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>That&#8217;s it! <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . You can add some modification like notification, or loader while processing.</p>
<p>- <a title="Simple star rating" href="http://dock.ronggur.com/tutorial/jquery_tutorial_starrating/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/jquery_tutorial_starrating/?referer=');">View Demo</a></p>
<p>- Download zip file <a class="downloadlink" href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=5" title="Version1 downloaded 2503 times" >jQuery Tutorial : Simple ajax star rating with php (2503)</a></p>
<p><em>This article inspired by <a href="http://www.yvoschaap.com/index.php/weblog/css_star_rater_ajax_version/" onclick="pageTracker._trackPageview('/outgoing/www.yvoschaap.com/index.php/weblog/css_star_rater_ajax_version/?referer=');">http://www.yvoschaap.com/</a> </em></p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for jQuery Tutorial : Simple ajax star rating with php" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+:+Simple+ajax+star+rating+with+php" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+_+Simple+ajax+star+rating+with+php&amp;referer=');">You can give me some coffee if you want to :D</a></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="pageTracker._trackPageview('/outgoing/blinklist.com/index.php?Action=Blink/addblink.php_amp_Name=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php_amp_Description=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php_amp_Url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Name=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php&amp;Description=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php&amp;Url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F" rel="nofollow" title="Add to&nbsp;BlinkList"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/blinklist.png" title="Add to&nbsp;BlinkList" alt="Add to&nbsp;BlinkList" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.bloglines.com/sub/http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F?referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.bloglines.com/sub/http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F" rel="nofollow" title="Add to&nbsp;Bloglines"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/bloglines.png" title="Add to&nbsp;Bloglines" alt="Add to&nbsp;Bloglines" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/del.icio.us/post?url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/digg.com/submit?phase=2_amp_url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.facebook.com/sharer.php?u=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.google.com/bookmarks/mark?op=edit_amp_output=popup_amp_bkmk=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.stumbleupon.com/submit?url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F_amp_title=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F&amp;title=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.technorati.com/faves?add=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/myweb2.search.yahoo.com/myresults/bookmarklet?u=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F05_2F30_2Fjquery-tutorial-simple-ajax-star-rating-with-php_2F_amp_t=jQuery+Tutorial+_3A+Simple+ajax+star+rating+with+php&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F05%2F30%2Fjquery-tutorial-simple-ajax-star-rating-with-php%2F&amp;t=jQuery+Tutorial+%3A+Simple+ajax+star+rating+with+php" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/' rel='bookmark' title='Permanent Link: jQuery Tutorial : Simple ajax star rating with php (extended)'>jQuery Tutorial : Simple ajax star rating with php (extended)</a> <small>Some people ask me question about how to implement my...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/05/30/jquery-tutorial-simple-ajax-star-rating-with-php/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>jQuery Tutorial : Horizontal Animated Menu</title>
		<link>http://sandbox.ronggur.com/2009/01/25/jquery-tutorial-horizontal-animated-menu/</link>
		<comments>http://sandbox.ronggur.com/2009/01/25/jquery-tutorial-horizontal-animated-menu/#comments</comments>
		<pubDate>Sun, 25 Jan 2009 16:07:58 +0000</pubDate>
		<dc:creator>ronggur</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery tutorial]]></category>

		<guid isPermaLink="false">http://sandbox.ronggur.com/?p=42</guid>
		<description><![CDATA[In this occasion, we&#8217;ll try to build basic horizontal animated menu using  jQuery. Ok, lets just start it
Step 1 : Create files needed
Ok, first let us create files needed to build this &#8216;menu&#8217;. All we need is :

jQuery library, you can download the latest version in http://code.google.com/p/jqueryjs/downloads/list
JavaScript document &#8211; let us named it &#8216;menu.js&#8217;
index.html
style.css

Let [...]


Related posts:<ol><li><a href='http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/' rel='bookmark' title='Permanent Link: jQuery Tutorial : Simple ajax star rating with php (extended)'>jQuery Tutorial : Simple ajax star rating with php (extended)</a> <small>Some people ask me question about how to implement my...</small></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In this occasion, we&#8217;ll try to build basic <a href="http://sandbox.ronggur.com/2009/01/25/jquery-tutorial-horizontal-animated-menu/">horizontal animated menu</a> using  jQuery. Ok, lets just start it</p>
<p><strong>Step 1 : Create files needed</strong></p>
<p>Ok, first let us create files needed to build this &#8216;menu&#8217;. All we need is :</p>
<ol>
<li>jQuery library, you can download the latest version in <a href="http://code.google.com/p/jqueryjs/downloads/list" onclick="pageTracker._trackPageview('/outgoing/code.google.com/p/jqueryjs/downloads/list?referer=');">http://code.google.com/p/jqueryjs/downloads/list</a></li>
<li>JavaScript document &#8211; let us named it &#8216;menu.js&#8217;</li>
<li>index.html</li>
<li>style.css</li>
</ol>
<p>Let we bundle it in one directory.</p>
<p><span id="more-42"></span></p>
<p><strong>Step 2:Build html structure</strong></p>
<p>After all files created then we can start from build some structure in index.html including embedding documents from outside (jQuery library, style.css, menu.js) into &lt;head&gt; section. If you too lazy to type it your self,  all you have to do just copy following code into your index.html<strong> </strong>:p.</p>
<pre class="brush: xml;">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;
&lt;title&gt;Jquery Tutorial : Horizontal animated menu&lt;/title&gt;
&lt;link type=&quot;text/css&quot; href=&quot;style.css&quot; rel=&quot;stylesheet&quot; media=&quot;screen&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;jquery-1.3.1.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;menu.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;wrapper&quot;&gt;
&lt;ul id=&quot;menu&quot;&gt;
&lt;li&gt;&lt;a href=&quot;#&quot; title=&quot;Go to the front page&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot; title=&quot;Want to know more about us?&quot;&gt;About Us&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot; title=&quot;Keep in touch with us, call any time you want&quot;&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Finished? lets go to the next step</p>
<p><strong>Step 3 : Create style sheet code </strong></p>
<p>We need some basic styles to make the menu working. Tag &lt;p&gt; is to display menu description. This &lt;p&gt; will create automatically by using  jQuery function and value in it is taken from <em>&#8216;title&#8217;</em> attribute in &lt;a&gt; inside the list. We&#8217;ll see it later.</p>
<pre class="brush: css;">

*{
margin:0;
padding:0;
}
body{
font:12px Arial, Helvetica, sans-serif;
color:white;
}
a{
text-decoration:none;
color:white;
}
#wrapper{
padding:40px 40px;
}
#menu{
float:left;
}
ul,li{
list-style:none;
}
li{
padding:10px 10px;
height:40px;
float:left;
width:100px;
background-color:#333333;
border-right:1px solid #666666;
overflow:hidden;
display:block;
}
li a{
float:left;
vertical-align:top;
position:absolute;
}
li p{
vertical-align:top;
text-align:left;
margin-left:0;
margin-top:0;
padding-left:65px;
width:155px;
text-align:right;
color:#CCCCCC;
display:none;
}
</pre>
<p><strong>Step 4: Create javascript code</strong></p>
<p>After styles code finished, last step is code for javascript. You can copy my code below. I already put comment each line.</p>
<p><strong>*update script in Friday 17 July 2009 -</strong> thanks to<strong> </strong><a href="http://www.pixelmakers.co.uk/" target="_self" onclick="pageTracker._trackPageview('/outgoing/www.pixelmakers.co.uk/?referer=');">http://www.pixelmakers.co.uk</a></p>
<pre class="brush: jscript;">

$(document).ready(function() {
// initialize default menu width

initwidth = $(&quot;li&quot;).width(); // updated

// hover in
$(&quot;li&quot;).hover( function(){
// get the title inside &lt;a&gt;
description = $(this).children(&quot;a&quot;).attr(&quot;title&quot;);
// start the animation
$(this).stop().animate({width: &quot;220&quot;},{queue:false, duration:&quot;fast&quot; });
// remove previously &lt;p&gt;
$(this).children(&quot;p&quot;).remove();
// create &lt;p&gt; and attach title into it
$(this).find(&quot;a&quot;).after(&quot;&lt;p&gt;&quot;+description+&quot;&lt;/p&gt;&quot;)
// create animation to make it looks good
$(this).children(&quot;p&quot;).stop().animate({ opacity: &quot;show&quot; }, {queue:false, duration:&quot;fast&quot;});
// hover out
},function(){
// animate it to the basic width
$(this).stop().animate({width: initwidth},{queue:false, duration:&quot;fast&quot;});
// fade out animation
$(this).children(&quot;p&quot;).stop().animate({ opacity: &quot;0&quot; }, {queue:false, duration:&quot;fast&quot;});
});
});
</pre>
<p>Done!, that&#8217;s all. If you’ve been following the steps correctly, the menu effect should working properly.</p>
<p>Let me know if there&#8217;s somethin more easy step to make the similar effect, cause i&#8217;m also in learning jQuery <img src='http://sandbox.ronggur.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>You can view the <a title="jquery tutorial : animated horizontal menu" href="http://dock.ronggur.com/tutorial/jquery%20tutorial%20-%20horizontal%20animated%20menu/" onclick="pageTracker._trackPageview('/outgoing/dock.ronggur.com/tutorial/jquery_20tutorial_20-_20horizontal_20animated_20menu/?referer=');">demo here</a> or download full sourcode <a href="http://sandbox.ronggur.com/wp-content/plugins/download-monitor/download.php?id=3" title="jQuery Tutorial : Horizontal Animated Menu">jQuery Tutorial : Horizontal Animated Menu</a> | size : 20.2 KB</p>
<p class="buymebeer"><form action="https://www.paypal.com/cgi-bin/webscr" target="paypal" method="post"><input type="hidden" name="cmd" value="_xclick" /><input type="hidden" name="business" value="ronggur.mh@gmail.com" /><input type="hidden" name="return" value="Thank you for your kindness :D" /><input type="hidden" name="item_name" value="Buy Me a Beer for jQuery Tutorial : Horizontal Animated Menu" /><input type="hidden" name="currency_code" value="USD" /><input type="hidden" name="amount" value="" /><input type="image" src="http://sandbox.ronggur.com/wp-content/plugins/buy-me-beer/icon_cafe.gif" align="left" alt="coffee" title="coffee" hspace="3" /></form><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&amp;business=ronggur.mh@gmail.com&amp;currency_code=USD&amp;amount=&amp;return=Thank you for your kindness :D&amp;item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+:+Horizontal+Animated+Menu" target="paypal" onclick="pageTracker._trackPageview('/outgoing/www.paypal.com/cgi-bin/webscr?cmd=_xclick_amp_business=ronggur.mh_gmail.com_amp_currency_code=USD_amp_amount=_amp_return=Thank_you_for_your_kindness_D_amp_item_name=Buy+Me+a+Beer+for+jQuery+Tutorial+_+Horizontal+Animated+Menu&amp;referer=');">You can give me some coffee if you want to :D</a></p><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="pageTracker._trackPageview('/outgoing/blinklist.com/index.php?Action=Blink/addblink.php_amp_Name=jQuery+Tutorial+_3A+Horizontal+Animated+Menu_amp_Description=jQuery+Tutorial+_3A+Horizontal+Animated+Menu_amp_Url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://blinklist.com/index.php?Action=Blink/addblink.php&amp;Name=jQuery+Tutorial+%3A+Horizontal+Animated+Menu&amp;Description=jQuery+Tutorial+%3A+Horizontal+Animated+Menu&amp;Url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F" rel="nofollow" title="Add to&nbsp;BlinkList"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/blinklist.png" title="Add to&nbsp;BlinkList" alt="Add to&nbsp;BlinkList" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.bloglines.com/sub/http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F?referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.bloglines.com/sub/http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F" rel="nofollow" title="Add to&nbsp;Bloglines"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/bloglines.png" title="Add to&nbsp;Bloglines" alt="Add to&nbsp;Bloglines" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/del.icio.us/post?url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F_amp_title=jQuery+Tutorial+_3A+Horizontal+Animated+Menu&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F&amp;title=jQuery+Tutorial+%3A+Horizontal+Animated+Menu" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/digg.com/submit?phase=2_amp_url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F_amp_title=jQuery+Tutorial+_3A+Horizontal+Animated+Menu&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F&amp;title=jQuery+Tutorial+%3A+Horizontal+Animated+Menu" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.facebook.com/sharer.php?u=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.google.com/bookmarks/mark?op=edit_amp_output=popup_amp_bkmk=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F_amp_title=jQuery+Tutorial+_3A+Horizontal+Animated+Menu&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F&amp;title=jQuery+Tutorial+%3A+Horizontal+Animated+Menu" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.stumbleupon.com/submit?url=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F_amp_title=jQuery+Tutorial+_3A+Horizontal+Animated+Menu&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F&amp;title=jQuery+Tutorial+%3A+Horizontal+Animated+Menu" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/www.technorati.com/faves?add=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="pageTracker._trackPageview('/outgoing/myweb2.search.yahoo.com/myresults/bookmarklet?u=http_3A_2F_2Fsandbox.ronggur.com_2F2009_2F01_2F25_2Fjquery-tutorial-horizontal-animated-menu_2F_amp_t=jQuery+Tutorial+_3A+Horizontal+Animated+Menu&amp;referer=');window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http%3A%2F%2Fsandbox.ronggur.com%2F2009%2F01%2F25%2Fjquery-tutorial-horizontal-animated-menu%2F&amp;t=jQuery+Tutorial+%3A+Horizontal+Animated+Menu" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://sandbox.ronggur.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->


<p>Related posts:<ol><li><a href='http://sandbox.ronggur.com/2010/01/19/jquery-tutorial-simple-ajax-star-rating-with-php-extended/' rel='bookmark' title='Permanent Link: jQuery Tutorial : Simple ajax star rating with php (extended)'>jQuery Tutorial : Simple ajax star rating with php (extended)</a> <small>Some people ask me question about how to implement my...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/' onclick="pageTracker._trackPageview('/outgoing/mitcho.com/code/yarpp/?referer=');">Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://sandbox.ronggur.com/2009/01/25/jquery-tutorial-horizontal-animated-menu/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
	</channel>
</rss>
