<?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>RRPowered</title>
	<atom:link href="http://www.rrpowered.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rrpowered.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Mar 2012 05:28:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Awesome jQuery Animated WebSite</title>
		<link>http://www.rrpowered.com/2012/03/awesome-jquery-animated-website/</link>
		<comments>http://www.rrpowered.com/2012/03/awesome-jquery-animated-website/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 00:56:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Animated]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=544</guid>
		<description><![CDATA[In this tutorial, I’m gonna show you how to make an awesome jQuery animated website. &#160; Demo The jQuery 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 &#8230; <a href="http://www.rrpowered.com/2012/03/awesome-jquery-animated-website/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>In this tutorial, I’m gonna show you how to make an awesome jQuery animated website.</h5>
<p><a href="http://www.rrpowered.com/2012/03/awesome-jquery-animated-website/" class="image-post"><img src="http://www.rrpowered.com/images/magic.png" alt="" class="post-img" /></a><br />
<span id="more-544"></span><br />
&nbsp;<br />
<a href="http://www.rrpowered.com/demo/animatedsite" alt="img" class="demo">Demo</a><br />
<b>The jQuery</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre>
<pre><span class="js">$<span class="js-bracket">(</span><span class="js-client-keyword">document</span><span class="js-bracket">)</span>.ready<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
    $<span class="js-bracket">(</span><span class="js-string">&quot;.nav_bar li&quot;</span><span class="js-bracket">)</span>.<span class="js-client-keyword">click</span><span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
    <span class="js-comment">/*Get the class from the menu button that was clicked*/</span>
	<span class="js-reserved-keyword">var</span> Tab <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.attr<span class="js-bracket">(</span><span class="js-string">&quot;class&quot;</span><span class="js-bracket">)</span>;
        <span class="js-comment">/*Slide the current DIV to the right 1500px*/</span>
	    $<span class="js-bracket">(</span><span class="js-string">&quot;.box&quot;</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
	        left <span class="js-operator">:</span> <span class="js-string">&quot;1500px&quot;</span>
		<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
                    <span class="js-comment">/*Now set the current DIV opacity to 0 and left 1500px then hide it*/</span>
		    $<span class="js-bracket">(</span><span class="js-string">&quot;.box&quot;</span><span class="js-bracket">)</span>.css<span class="js-bracket">(</span><span class="js-string">&quot;left&quot;</span>, <span class="js-string">&quot;-1500px&quot;</span><span class="js-bracket">)</span>.hide<span class="js-bracket">(</span><span class="js-bracket">)</span>;
                    <span class="js-comment">/*Show the new div slide right to 0px, set opacity to 100% then stop the animation*/</span>
		        $<span class="js-bracket">(</span><span class="js-string">&quot;#&quot;</span> <span class="js-operator">+</span> Tab<span class="js-bracket">)</span>.show<span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
			    left <span class="js-operator">:</span> <span class="js-string">&quot;0px&quot;</span>,
			    opacity <span class="js-operator">:</span> <span class="js-number">1</span>.<span class="js-number">0</span>
			<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>;
	   <span class="js-bracket">}</span><span class="js-bracket">)</span>;
    <span class="js-bracket">}</span><span class="js-bracket">)</span>;
<span class="js-bracket">}</span><span class="js-bracket">)</span>;</span></pre>
</div>
<p><b>Now for the HTML</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre>
<pre><span class="html"><span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;outer&quot;</span>&gt;</span>
    <span class="html-comment">&lt;!--Here is the nav bar --&gt;</span>
    <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;nav_bar&quot;</span>&gt;</span>
        <span class="html-comment">&lt;!--Inside our nav bar we have a list to display all of our pages --&gt;</span>
        <span class="html-other-element">&lt;ul&gt;</span>
	    <span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p1&quot;</span>&gt;</span>
	    Home
	    <span class="html-other-element">&lt;/li&gt;</span>
	    <span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p2&quot;</span>&gt;</span>
	    Page 1
	    <span class="html-other-element">&lt;/li&gt;</span>
	    <span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p3&quot;</span>&gt;</span>
	    Page 2
	    <span class="html-other-element">&lt;/li&gt;</span>
	    <span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p4&quot;</span>&gt;</span>
	    Page 3
	    <span class="html-other-element">&lt;/li&gt;</span>
	<span class="html-other-element">&lt;/ul&gt;</span>
    <span class="html-other-element">&lt;/div&gt;</span>
    <span class="html-comment">&lt;!-- Now for the page content --&gt;</span>
    <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;container&quot;</span>&gt;</span>
        <span class="html-comment">&lt;!-- We have a div for every page --&gt;</span>
        <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p1&quot;</span>&gt;</span>
	    <span class="html-other-element">&lt;h3&gt;</span>Home<span class="html-other-element">&lt;/h3&gt;</span>
	<span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p2&quot;</span>&gt;</span>
	    <span class="html-other-element">&lt;h3&gt;</span>Page 1<span class="html-other-element">&lt;/h3&gt;</span>
	<span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p3&quot;</span>&gt;</span>
	    <span class="html-other-element">&lt;h3&gt;</span>Page 2<span class="html-other-element">&lt;/h3&gt;</span>
	<span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p4&quot;</span>&gt;</span>
	    <span class="html-other-element">&lt;h3&gt;</span>Page 3<span class="html-other-element">&lt;/h3&gt;</span>
	<span class="html-other-element">&lt;/div&gt;</span>
    <span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span></span></pre>
</div>
<p><b>Now put the whole thing together!</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
</pre>
<pre><span class="html"><span class="html-comment">&lt;!-- Created by Barrett at RRPowered.com --&gt;</span>
<span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.1//EN&quot;</span>
<span class="html-attribute">&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html&gt;</span>
	<span class="html-other-element">&lt;head&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;http://ajax.googleapis.com/
		ajax/libs/jquery/1.7.1/jquery.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
		<span class="html-other-element">&lt;link rel=<span class="html-attribute">&quot;stylesheet&quot;</span> type=<span class="html-attribute">&quot;text/css&quot;</span> href=<span class="html-attribute">&quot;styles.css&quot;</span> /&gt;</span>
		<span class="html-other-element">&lt;title&gt;</span>Awesome Animated Website<span class="html-other-element">&lt;/title&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
			$<span class="js-bracket">(</span><span class="js-client-keyword">document</span><span class="js-bracket">)</span>.ready<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
				$<span class="js-bracket">(</span><span class="js-string">&quot;.nav_bar li&quot;</span><span class="js-bracket">)</span>.<span class="js-client-keyword">click</span><span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>

					<span class="js-comment">/*Get the class from the menu button that was clicked*/</span>
					<span class="js-reserved-keyword">var</span> Tab <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.attr<span class="js-bracket">(</span><span class="js-string">&quot;class&quot;</span><span class="js-bracket">)</span>;

					<span class="js-comment">/*Slide the current DIV to the right 1500px*/</span>
					$<span class="js-bracket">(</span><span class="js-string">&quot;.box&quot;</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
						left <span class="js-operator">:</span> <span class="js-string">&quot;1500px&quot;</span>
					<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>

						<span class="js-comment">/*Now set the current DIV opacity to 0 and left 1500px then hide it*/</span>
						$<span class="js-bracket">(</span><span class="js-string">&quot;.box&quot;</span><span class="js-bracket">)</span>.css<span class="js-bracket">(</span><span class="js-string">&quot;left&quot;</span>, <span class="js-string">&quot;-1500px&quot;</span><span class="js-bracket">)</span>.hide<span class="js-bracket">(</span><span class="js-bracket">)</span>;

						<span class="js-comment">/*Show the new div slide right to 0px, set opacity to 100% then stop the animation*/</span>
						$<span class="js-bracket">(</span><span class="js-string">&quot;#&quot;</span> <span class="js-operator">+</span> Tab<span class="js-bracket">)</span>.show<span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
							left <span class="js-operator">:</span> <span class="js-string">&quot;0px&quot;</span>,
							opacity <span class="js-operator">:</span> <span class="js-number">1</span>.<span class="js-number">0</span>
						<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>;
					<span class="js-bracket">}</span><span class="js-bracket">)</span>;
				<span class="js-bracket">}</span><span class="js-bracket">)</span>;
			<span class="js-bracket">}</span><span class="js-bracket">)</span>;
		</span></span>&lt;/script&gt;</span>
	<span class="html-other-element">&lt;/head&gt;</span>
	<span class="html-other-element">&lt;body&gt;</span>
		<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;outer&quot;</span>&gt;</span>
			<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;nav_bar&quot;</span>&gt;</span>
				<span class="html-other-element">&lt;ul&gt;</span>
					<span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p1&quot;</span>&gt;</span>
						Home
					<span class="html-other-element">&lt;/li&gt;</span>
					<span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p2&quot;</span>&gt;</span>
						Page 1
					<span class="html-other-element">&lt;/li&gt;</span>
					<span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p3&quot;</span>&gt;</span>
						Page 2
					<span class="html-other-element">&lt;/li&gt;</span>
					<span class="html-other-element">&lt;li class=<span class="html-attribute">&quot;p4&quot;</span>&gt;</span>
						Page 3
					<span class="html-other-element">&lt;/li&gt;</span>
				<span class="html-other-element">&lt;/ul&gt;</span>
			<span class="html-other-element">&lt;/div&gt;</span>
			<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;container&quot;</span>&gt;</span>
				<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
				<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p1&quot;</span>&gt;</span>
					<span class="html-other-element">&lt;h3&gt;</span>Home<span class="html-other-element">&lt;/h3&gt;</span>
				<span class="html-other-element">&lt;/div&gt;</span>
				<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p2&quot;</span>&gt;</span>
					<span class="html-other-element">&lt;h3&gt;</span>Page 1<span class="html-other-element">&lt;/h3&gt;</span>
				<span class="html-other-element">&lt;/div&gt;</span>
				<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p3&quot;</span>&gt;</span>
					<span class="html-other-element">&lt;h3&gt;</span>Page 2<span class="html-other-element">&lt;/h3&gt;</span>
				<span class="html-other-element">&lt;/div&gt;</span>
				<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box&quot;</span> id=<span class="html-attribute">&quot;p4&quot;</span>&gt;</span>
					<span class="html-other-element">&lt;h3&gt;</span>Page 3<span class="html-other-element">&lt;/h3&gt;</span>
				<span class="html-other-element">&lt;/div&gt;</span>
			<span class="html-other-element">&lt;/div&gt;</span>
		<span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
</pre>
<pre><span class="css"><span class="css-comment">/*Created by Barrett at RRPowered.com*/</span>
.outer {
   <span class="css-property">padding 0</span>;
   <span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
   }   

.nav_bar {
   <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 850px</span></span>;
   <span class="css-property">margin-top<span class="css-selector">:</span><span class="css-value"> 60px</span></span>;
   <span class="css-property">margin-left<span class="css-selector">:</span><span class="css-value"> auto</span></span>;
   <span class="css-property">margin-right<span class="css-selector">:</span><span class="css-value"> auto</span></span>;
   <span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #f5f5f5</span></span>;
   <span class="css-property">border<span class="css-selector">:</span><span class="css-value"> solid #bfbfbf 2px</span></span>;
   <span class="css-property">-moz-border-radius<span class="css-selector">:</span><span class="css-value"> 8px</span></span>;
   <span class="css-property">border-radius<span class="css-selector">:</span><span class="css-value"> 8px</span></span>;
   <span class="css-property">overflow<span class="css-selector">:</span><span class="css-value"> hidden</span></span>;
   }

.nav_bar ul {
   <span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
   <span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
   <span class="css-property">list-style<span class="css-selector">:</span><span class="css-value"> none</span></span>;
   }

.nav_bar li {
   <span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 6px 8px 6px 8px</span></span>;
   <span class="css-property">border-right<span class="css-selector">:</span><span class="css-value"> solid #bfbfbf 2px</span></span>;
   <span class="css-property">cursor<span class="css-selector">:</span><span class="css-value"> pointer</span></span>;
   <span class="css-property">font-weight<span class="css-selector">:</span><span class="css-value"> bold</span></span>;
   <span class="css-property">display<span class="css-selector">:</span><span class="css-value"> inline</span></span>;
   <span class="css-property">float<span class="css-selector">:</span><span class="css-value">left</span></span>;
   }   

.nav_bar li:hover {
   <span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #e2e2e2</span></span>;
   } 

.box {
   <span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 10px</span></span>;
   <span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #f5f5f5</span></span>;
   <span class="css-property">border<span class="css-selector">:</span><span class="css-value"> solid #bfbfbf 2px</span></span>;
   <span class="css-property">-moz-border-radius<span class="css-selector">:</span><span class="css-value"> 8px</span></span>;
   <span class="css-property">border-radius<span class="css-selector">:</span><span class="css-value"> 8px</span></span>;
   }   

.box {
   <span class="css-property">display<span class="css-selector">:</span><span class="css-value"> none</span></span>;
   <span class="css-property">position<span class="css-selector">:</span><span class="css-value"> relative</span></span>;
   } 

.container {
   <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 850px</span></span>;
   <span class="css-property">margin-top<span class="css-selector">:</span><span class="css-value"> 30px</span></span>;
   <span class="css-property">margin-left<span class="css-selector">:</span><span class="css-value"> auto</span></span>;
   <span class="css-property">margin-right<span class="css-selector">:</span><span class="css-value"> auto</span></span>;
   <span class="css-property">overflow<span class="css-selector">:</span><span class="css-value">hidden</span></span>;
   } 

 #p1 {
   <span class="css-property">display<span class="css-selector">:</span><span class="css-value"> block</span></span>;
   }</span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/03/awesome-jquery-animated-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use jQuery to load external files</title>
		<link>http://www.rrpowered.com/2012/02/use-jquery-to-load-external-files/</link>
		<comments>http://www.rrpowered.com/2012/02/use-jquery-to-load-external-files/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 04:05:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Load External File]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=534</guid>
		<description><![CDATA[I’m going to show you an easy way to load a external file using jQuery and use a loading image while file loads. &#160; Demo lets go!!!. We are gonna use the jQuery .load() function to load are external page. &#8230; <a href="http://www.rrpowered.com/2012/02/use-jquery-to-load-external-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>I’m going to show you an easy way to load a external file using jQuery and use a loading image while file loads.</h5>
<p><a href="http://www.rrpowered.com/2012/02/use-jquery-to-load-external-files/" class="image-post"><img src="http://www.rrpowered.com/images/ex.gif" alt="" class="post-img" /></a><br />
<span id="more-534"></span><br />
&nbsp;<br />
<a href="http://www.rrpowered.com/demo/loadex" alt="img" class="demo">Demo</a><br />
<b>lets go!!!.</b><br />
We are gonna use the jQuery <b>.load()</b> function to load are external page.<br />
The code below will load the <b>external.html</b> file into a div with the class of <b>.loaded_files</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="html">$(&quot;.loaded_files&quot;).load('external.html');</span></pre>
</div>
<p><b>We&#8217;re all done!</b><br />
Now that we know how it works, let&#8217;s put it all together.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
</pre>
<pre><span class="html"><span class="html-comment">&lt;!-- Created by Barrett at RRPowered.com --&gt;</span>
<span class="html-comment">&lt;!-- File name index.html --&gt;</span>
<span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.1//EN&quot;</span>
<span class="html-attribute">&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html&gt;</span>
	<span class="html-other-element">&lt;head&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;http://ajax.googleapis.com/ajax/
		libs/jquery/1.7.1/jquery.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
		<span class="html-other-element">&lt;title&gt;</span>Load external files with jQuery Demo<span class="html-other-element">&lt;/title&gt;</span>
		<span class="html-style-element">&lt;style type=<span class="css-string">&quot;text/css&quot;</span>&gt;<span class="css"><span class="css">
			.load_files {
				<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 5px</span></span>;
				<span class="css-property">font-weight<span class="css-selector">:</span><span class="css-value"> bold</span></span>;
				<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #A9F5A9</span></span>;
				<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> solid #333333 1px</span></span>;
				<span class="css-property">cursor<span class="css-selector">:</span><span class="css-value"> pointer</span></span>;
			}
			<span class="css-comment">/* The loading image */</span>
			.loading {
				<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 20px</span></span>;
				<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 20px</span></span>;
				<span class="css-property">background-image<span class="css-selector">:</span><span class="css-value"> url(<span class="css-string">'loader.gif'</span>)</span></span>;
				<span class="css-property">display<span class="css-selector">:</span><span class="css-value"> none</span></span>;
			}

		</span></span>&lt;/style&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
			$<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
				$<span class="js-bracket">(</span><span class="js-string">&quot;.load_files&quot;</span><span class="js-bracket">)</span>.<span class="js-client-keyword">click</span><span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
					$<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.hide<span class="js-bracket">(</span><span class="js-bracket">)</span>;
					<span class="js-comment">/* When load files button is clicked hide it */</span>
					$<span class="js-bracket">(</span><span class="js-string">&quot;.loading&quot;</span><span class="js-bracket">)</span>.show<span class="js-bracket">(</span><span class="js-bracket">)</span>;
					<span class="js-comment">/* Show loading image */</span>
					<span class="js-comment">/* Load the external file */</span>
					$<span class="js-bracket">(</span><span class="js-string">&quot;.loaded_files&quot;</span><span class="js-bracket">)</span>.<span class="js-client-keyword">load</span><span class="js-bracket">(</span><span class="js-string">'external.html'</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
						$<span class="js-bracket">(</span><span class="js-string">&quot;.loading&quot;</span><span class="js-bracket">)</span>.hide<span class="js-bracket">(</span><span class="js-bracket">)</span>;
						<span class="js-comment">/* Hide loading image when external file is loaded */</span>
					<span class="js-bracket">}</span><span class="js-bracket">)</span>;
				<span class="js-bracket">}</span><span class="js-bracket">)</span>;
			<span class="js-bracket">}</span><span class="js-bracket">)</span>;

		</span></span>&lt;/script&gt;</span>
	<span class="html-other-element">&lt;/head&gt;</span>
	<span class="html-other-element">&lt;body&gt;</span>
		<span class="html-other-element">&lt;h2&gt;</span>Load external files with jQuery<span class="html-other-element">&lt;/h2&gt;</span>
		<span class="html-form-element">&lt;button class=<span class="html-attribute">&quot;load_files&quot;</span>&gt;</span>
			Load Files
		<span class="html-form-element">&lt;/button&gt;</span>
		<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;loading&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
		<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;loaded_files&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
<p><b>Now for the external file.</b><br />
external.html</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="html"><span class="html-other-element">&lt;p&gt;</span>External File Loaded With jQuery<span class="html-other-element">&lt;/p&gt;</span></span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/02/use-jquery-to-load-external-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery simple image slide</title>
		<link>http://www.rrpowered.com/2012/02/jquery-simple-image-slide/</link>
		<comments>http://www.rrpowered.com/2012/02/jquery-simple-image-slide/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 03:48:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Image Slide]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=514</guid>
		<description><![CDATA[A simple jQuery image slide for use on you website or blog. &#160; Demo lets get started. Here is the javascript. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 &#8230; <a href="http://www.rrpowered.com/2012/02/jquery-simple-image-slide/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>A simple jQuery image slide for use on you website or blog.</h5>
<p><a href="http://www.rrpowered.com/2012/02/jquery-simple-image-slide/" class="image-post"><img src="http://www.rrpowered.com/images/imageslide.gif" alt="" class="post-img" /></a><br />
<span id="more-514"></span><br />
&nbsp;<br />
<a href="http://www.rrpowered.com/demo/imageslide" alt="img" class="demo">Demo</a><br />
<b>lets get started.</b><br />
Here is the javascript. </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
</pre>
<pre><span class="js">$<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
    	<span class="js-native-keyword">setInterval</span><span class="js-bracket">(</span><span class="js-string">&quot;slide()&quot;</span>, <span class="js-number">5</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>;
    	<span class="js-comment">//Time is in milliseconds 5000ms is equivalent to 5sec
</span>
    <span class="js-bracket">}</span><span class="js-bracket">)</span>;
    <span class="js-comment">//Call the slide function
</span>
    <span class="js-function-keyword">function</span> slide<span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>

    	<span class="js-reserved-keyword">var</span> act <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-string">&quot;#slide img.active&quot;</span><span class="js-bracket">)</span>;
    	<span class="js-comment">//Get the current active image
</span>

    	<span class="js-reserved-keyword">var</span> img_src <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-string">&quot;#slide img.active&quot;</span><span class="js-bracket">)</span>.attr<span class="js-bracket">(</span><span class="js-string">&quot;src&quot;</span><span class="js-bracket">)</span>;
    	<span class="js-comment">//Get the image path
</span>

    	<span class="js-reserved-keyword">if</span><span class="js-bracket">(</span>act.length <span class="js-operator">=</span><span class="js-operator">=</span> <span class="js-number">0</span><span class="js-bracket">)</span>
    		act <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-string">'#slide img:last'</span><span class="js-bracket">)</span>;
    	<span class="js-comment">//If active equals 0 set act to last img
</span>

    	<span class="js-reserved-keyword">var</span> nex <span class="js-operator">=</span> act.next<span class="js-bracket">(</span><span class="js-bracket">)</span>.length <span class="js-operator">?</span> act.next<span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-operator">:</span> $<span class="js-bracket">(</span><span class="js-string">'#slide img:first'</span><span class="js-bracket">)</span>;
    	<span class="js-comment">/*If next active
    	 image equals 0 go to first image  if not go to next image */</span>

    	nex.addClass<span class="js-bracket">(</span><span class="js-string">'active'</span><span class="js-bracket">)</span>;
    	<span class="js-comment">//Set the class active to image
</span>

    	$<span class="js-bracket">(</span><span class="js-string">&quot;.append_image&quot;</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
    		opacity <span class="js-operator">:</span> <span class="js-number">0</span>.<span class="js-number">0</span><span class="js-number">5</span>
    	<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span><span class="js-comment">//Fade old image out
</span>
    		$<span class="js-bracket">(</span><span class="js-string">&quot;.append_image&quot;</span><span class="js-bracket">)</span>.attr<span class="js-bracket">(</span><span class="js-string">&quot;src&quot;</span>, <span class="js-string">&quot;&quot;</span> <span class="js-operator">+</span> img_src<span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
    			opacity <span class="js-operator">:</span> <span class="js-number">1</span>.<span class="js-number">0</span>
    		<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span><span class="js-comment">//Fade new image in
</span>
    			act.removeClass<span class="js-bracket">(</span><span class="js-string">'active last-active'</span><span class="js-bracket">)</span>;
    			<span class="js-comment">//Remove classes &quot;active&quot; and &quot;last-active&quot;
</span>
    		<span class="js-bracket">}</span><span class="js-bracket">)</span>;
    	<span class="js-bracket">}</span><span class="js-bracket">)</span>;
    <span class="js-bracket">}</span></span></pre>
</div>
<p><b>The HTML</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre>
<pre><span class="html"><span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;frame&quot;</span>&gt;</span>
	<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imaged.png&quot;</span> alt=<span class="html-attribute">&quot;d&quot;</span> class=<span class="html-attribute">&quot;append_image&quot;</span>&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;slide&quot;</span>&gt;</span>
	<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imagea.png&quot;</span> alt=<span class="html-attribute">&quot;a&quot;</span> class=<span class="html-attribute">&quot;active&quot;</span>&gt;</span>
	<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imageb.png&quot;</span> alt=<span class="html-attribute">&quot;b&quot;</span>&gt;</span>
	<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imagec.png&quot;</span> alt=<span class="html-attribute">&quot;c&quot;</span>&gt;</span>
	<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imaged.png&quot;</span> alt=<span class="html-attribute">&quot;d&quot;</span>&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span></span></pre>
</div>
<p><b>Now put the whole code together!</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
</pre>
<pre><span class="html"><span class="html-comment">&lt;!-- Created by Barrett at RRPowered.com --&gt;</span>
<span class="html-comment">&lt;!-- File name index.html --&gt;</span>
<span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.1//EN&quot;</span>
<span class="html-attribute">&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html&gt;</span>
	<span class="html-other-element">&lt;head&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;http://ajax.googleapis.com/ajax/
		libs/jquery/1.7.1/jquery.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
		<span class="html-other-element">&lt;title&gt;</span>A simple jQuery image slide<span class="html-other-element">&lt;/title&gt;</span>
		<span class="html-style-element">&lt;style type=<span class="css-string">&quot;text/css&quot;</span>&gt;<span class="css"><span class="css">
			body {
				<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 200px 0 0 400px</span></span>;
				<span class="css-property">font-family<span class="css-selector">:</span><span class="css-value"> <span class="css-string">&quot;arial&quot;</span></span></span>;
			}
			#slide {
				<span class="css-property">display<span class="css-selector">:</span><span class="css-value"> none</span></span>;
			}
			#frame {
				<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 104px</span></span>;
				<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 420px</span></span>;
				<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 10px</span></span>;
				<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> solid #808080 2px</span></span>;
			}
		</span></span>&lt;/style&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
			$<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
				<span class="js-native-keyword">setInterval</span><span class="js-bracket">(</span><span class="js-string">&quot;slide()&quot;</span>, <span class="js-number">5</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>;
				<span class="js-comment">//Time is in milliseconds 5000ms is equivalent to 5sec
</span>
			<span class="js-bracket">}</span><span class="js-bracket">)</span>;
			<span class="js-comment">//Call the slide function
</span>
			<span class="js-function-keyword">function</span> slide<span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>

				<span class="js-reserved-keyword">var</span> act <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-string">&quot;#slide img.active&quot;</span><span class="js-bracket">)</span>;
				<span class="js-comment">//Get the current active image
</span>

				<span class="js-reserved-keyword">var</span> img_src <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-string">&quot;#slide img.active&quot;</span><span class="js-bracket">)</span>.attr<span class="js-bracket">(</span><span class="js-string">&quot;src&quot;</span><span class="js-bracket">)</span>;
				<span class="js-comment">//Get the image path
</span>

				<span class="js-reserved-keyword">if</span><span class="js-bracket">(</span>act.length <span class="js-operator">=</span><span class="js-operator">=</span> <span class="js-number">0</span><span class="js-bracket">)</span>
					act <span class="js-operator">=</span> $<span class="js-bracket">(</span><span class="js-string">'#slide img:last'</span><span class="js-bracket">)</span>;
				<span class="js-comment">//If active equals 0 set act to last img
</span>

				<span class="js-reserved-keyword">var</span> nex <span class="js-operator">=</span> act.next<span class="js-bracket">(</span><span class="js-bracket">)</span>.length <span class="js-operator">?</span> act.next<span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-operator">:</span> $<span class="js-bracket">(</span><span class="js-string">'#slide img:first'</span><span class="js-bracket">)</span>;
				<span class="js-comment">/*If next active
				 image equals 0 go to first image  if not go to next image */</span>

				nex.addClass<span class="js-bracket">(</span><span class="js-string">'active'</span><span class="js-bracket">)</span>;
				<span class="js-comment">//Set the class active to image
</span>

				$<span class="js-bracket">(</span><span class="js-string">&quot;.append_image&quot;</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
					opacity <span class="js-operator">:</span> <span class="js-number">0</span>.<span class="js-number">0</span><span class="js-number">5</span>
				<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span><span class="js-comment">//Fade old image out
</span>
					$<span class="js-bracket">(</span><span class="js-string">&quot;.append_image&quot;</span><span class="js-bracket">)</span>.attr<span class="js-bracket">(</span><span class="js-string">&quot;src&quot;</span>, <span class="js-string">&quot;&quot;</span> <span class="js-operator">+</span> img_src<span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
						opacity <span class="js-operator">:</span> <span class="js-number">1</span>.<span class="js-number">0</span>
					<span class="js-bracket">}</span>, <span class="js-number">1</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-number">0</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span><span class="js-comment">//Fade new image in
</span>
						act.removeClass<span class="js-bracket">(</span><span class="js-string">'active last-active'</span><span class="js-bracket">)</span>;
						<span class="js-comment">//Remove classes &quot;active&quot; and &quot;last-active&quot;
</span>
					<span class="js-bracket">}</span><span class="js-bracket">)</span>;
				<span class="js-bracket">}</span><span class="js-bracket">)</span>;
			<span class="js-bracket">}</span>
		</span></span>&lt;/script&gt;</span>
	<span class="html-other-element">&lt;/head&gt;</span>
	<span class="html-other-element">&lt;body&gt;</span>
		<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;frame&quot;</span>&gt;</span>
			<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imaged.png&quot;</span> alt=<span class="html-attribute">&quot;d&quot;</span> class=<span class="html-attribute">&quot;append_image&quot;</span>&gt;</span>
		<span class="html-other-element">&lt;/div&gt;</span>
		<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;slide&quot;</span>&gt;</span>
			<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imagea.png&quot;</span> alt=<span class="html-attribute">&quot;a&quot;</span> class=<span class="html-attribute">&quot;active&quot;</span>&gt;</span>
			<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imageb.png&quot;</span> alt=<span class="html-attribute">&quot;b&quot;</span>&gt;</span>
			<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imagec.png&quot;</span> alt=<span class="html-attribute">&quot;c&quot;</span>&gt;</span>
			<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;imaged.png&quot;</span> alt=<span class="html-attribute">&quot;d&quot;</span>&gt;</span>
		<span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/02/jquery-simple-image-slide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Growing Menu</title>
		<link>http://www.rrpowered.com/2012/02/jquery-growing-menu/</link>
		<comments>http://www.rrpowered.com/2012/02/jquery-growing-menu/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 05:44:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Animated]]></category>
		<category><![CDATA[Growing]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menu]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=498</guid>
		<description><![CDATA[Today We are gonna make a horizontal expanding menu using jQuery and css. &#160; Demo Let&#8217;s start with the jQuery. When the menu gets moused over we will animate and show the hidden text. On mouseout will will hide the &#8230; <a href="http://www.rrpowered.com/2012/02/jquery-growing-menu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Today We are gonna make a horizontal expanding menu using jQuery and css.</h5>
<p><a href="http://www.rrpowered.com/2012/02/jquery-growing-menu/" class="image-post"><img src="http://www.rrpowered.com/images/growingmenu.png" alt="" class="post-img" /></a><br />
<span id="more-498"></span><br />
&nbsp;<br />
<a href="http://www.rrpowered.com/demo/growingmenu/" alt="img" class="demo">Demo</a><br />
<b>Let&#8217;s start with the jQuery.</b><br />
When the menu gets moused over we will animate and show the hidden text. On mouseout will will hide the text once again.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre>
<pre><span class="js">$<span class="js-bracket">(</span><span class="js-client-keyword">document</span><span class="js-bracket">)</span>.ready<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
    $<span class="js-bracket">(</span><span class="js-string">&quot;.nav_bar li&quot;</span><span class="js-bracket">)</span>.mouseover<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
        $<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
            width <span class="js-operator">:</span> <span class="js-string">'350px'</span>
        <span class="js-bracket">}</span>, <span class="js-number">5</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>;
    <span class="js-bracket">}</span><span class="js-bracket">)</span>;

    $<span class="js-bracket">(</span><span class="js-string">&quot;.nav_bar li&quot;</span><span class="js-bracket">)</span>.mouseout<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
        $<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
            width <span class="js-operator">:</span> <span class="js-string">'130px'</span>
        <span class="js-bracket">}</span>, <span class="js-number">5</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>;
    <span class="js-bracket">}</span><span class="js-bracket">)</span>;
<span class="js-bracket">}</span><span class="js-bracket">)</span>;</span></pre>
</div>
<p><b>The HTML structure.</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
</pre>
<pre><span class="html"><span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;nav_bar&quot;</span>&gt;</span>
	<span class="html-other-element">&lt;ul&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>
			<span class="html-other-element">&lt;span&gt;</span>Menu Tab 1<span class="html-other-element">&lt;/span&gt;</span>
			<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 1<span class="html-other-element">&lt;/span&gt;</span>
		<span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>
			<span class="html-other-element">&lt;span&gt;</span>Menu Tab 2<span class="html-other-element">&lt;/span&gt;</span>
			<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 2<span class="html-other-element">&lt;/span&gt;</span>
		<span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>
			<span class="html-other-element">&lt;span&gt;</span>Menu Tab 3<span class="html-other-element">&lt;/span&gt;</span>
			<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 3<span class="html-other-element">&lt;/span&gt;</span>
		<span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>
			<span class="html-other-element">&lt;span&gt;</span>Menu Tab 4<span class="html-other-element">&lt;/span&gt;</span>
			<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 4<span class="html-other-element">&lt;/span&gt;</span>
		<span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>
			<span class="html-other-element">&lt;span&gt;</span>Menu Tab 5<span class="html-other-element">&lt;/span&gt;</span>
			<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 5<span class="html-other-element">&lt;/span&gt;</span>
		<span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>
			<span class="html-other-element">&lt;span&gt;</span>Menu Tab 6<span class="html-other-element">&lt;/span&gt;</span>
			<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 6<span class="html-other-element">&lt;/span&gt;</span>
		<span class="html-other-element">&lt;/li&gt;</span>
	<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span></span></pre>
</div>
<p><b>Now put it all together!</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
</pre>
<pre><span class="html"><span class="html-comment">&lt;!-- Created by Barrett at RRPowered.com --&gt;</span>
<span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.1//EN&quot;</span>
<span class="html-attribute">&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html&gt;</span>
    <span class="html-other-element">&lt;head&gt;</span>
	    <span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;http://ajax.googleapis.com/
		ajax/libs/jquery/1.7.1/jquery.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
		<span class="html-other-element">&lt;link rel=<span class="html-attribute">&quot;stylesheet&quot;</span> type=<span class="html-attribute">&quot;text/css&quot;</span> href=<span class="html-attribute">&quot;style.css&quot;</span> /&gt;</span>
		<span class="html-other-element">&lt;title&gt;</span>Growing Menu<span class="html-other-element">&lt;/title&gt;</span>
		<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
			$<span class="js-bracket">(</span><span class="js-client-keyword">document</span><span class="js-bracket">)</span>.ready<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
				$<span class="js-bracket">(</span><span class="js-string">&quot;.nav_bar li&quot;</span><span class="js-bracket">)</span>.mouseover<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
					$<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
						width <span class="js-operator">:</span> <span class="js-string">'350px'</span>
					<span class="js-bracket">}</span>, <span class="js-number">5</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>;
				<span class="js-bracket">}</span><span class="js-bracket">)</span>;

				$<span class="js-bracket">(</span><span class="js-string">&quot;.nav_bar li&quot;</span><span class="js-bracket">)</span>.mouseout<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
					$<span class="js-bracket">(</span><span class="js-reserved-keyword">this</span><span class="js-bracket">)</span>.<span class="js-client-keyword">stop</span><span class="js-bracket">(</span><span class="js-bracket">)</span>.animate<span class="js-bracket">(</span><span class="js-bracket">{</span>
						width <span class="js-operator">:</span> <span class="js-string">'130px'</span>
					<span class="js-bracket">}</span>, <span class="js-number">5</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>;
				<span class="js-bracket">}</span><span class="js-bracket">)</span>;
			<span class="js-bracket">}</span><span class="js-bracket">)</span>;
		</span></span>&lt;/script&gt;</span>
	<span class="html-other-element">&lt;/head&gt;</span>
	<span class="html-other-element">&lt;body&gt;</span>
		<span class="html-other-element">&lt;h3&gt;</span>Growing Menu with jQuery<span class="html-other-element">&lt;/h3&gt;</span>
		<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;nav_bar&quot;</span>&gt;</span>
			<span class="html-other-element">&lt;ul&gt;</span>
				<span class="html-other-element">&lt;li&gt;</span>
					<span class="html-other-element">&lt;span&gt;</span>Menu Tab 1<span class="html-other-element">&lt;/span&gt;</span>
					<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 1<span class="html-other-element">&lt;/span&gt;</span>
				<span class="html-other-element">&lt;/li&gt;</span>
				<span class="html-other-element">&lt;li&gt;</span>
					<span class="html-other-element">&lt;span&gt;</span>Menu Tab 2<span class="html-other-element">&lt;/span&gt;</span>
					<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 2<span class="html-other-element">&lt;/span&gt;</span>
				<span class="html-other-element">&lt;/li&gt;</span>
				<span class="html-other-element">&lt;li&gt;</span>
					<span class="html-other-element">&lt;span&gt;</span>Menu Tab 3<span class="html-other-element">&lt;/span&gt;</span>
					<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 3<span class="html-other-element">&lt;/span&gt;</span>
				<span class="html-other-element">&lt;/li&gt;</span>
				<span class="html-other-element">&lt;li&gt;</span>
					<span class="html-other-element">&lt;span&gt;</span>Menu Tab 4<span class="html-other-element">&lt;/span&gt;</span>
					<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 4<span class="html-other-element">&lt;/span&gt;</span>
				<span class="html-other-element">&lt;/li&gt;</span>
				<span class="html-other-element">&lt;li&gt;</span>
					<span class="html-other-element">&lt;span&gt;</span>Menu Tab 5<span class="html-other-element">&lt;/span&gt;</span>
					<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 5<span class="html-other-element">&lt;/span&gt;</span>
				<span class="html-other-element">&lt;/li&gt;</span>
				<span class="html-other-element">&lt;li&gt;</span>
					<span class="html-other-element">&lt;span&gt;</span>Menu Tab 6<span class="html-other-element">&lt;/span&gt;</span>
					<span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;whole&quot;</span>&gt;</span>The Whole Menu Tab 6<span class="html-other-element">&lt;/span&gt;</span>
				<span class="html-other-element">&lt;/li&gt;</span>
			<span class="html-other-element">&lt;/ul&gt;</span>
		<span class="html-other-element">&lt;/div&gt;</span>
	<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
<p><b>Now for the styling</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
</pre>
<pre><span class="css"><span class="css-comment">/*Created by Barrett at RRPowered.com*/</span>
body {
	<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
	<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
	<span class="css-property">font-family<span class="css-selector">:</span><span class="css-value"> <span class="css-string">&quot;arial&quot;</span></span></span>;
	<span class="css-property">font-size<span class="css-selector">:</span><span class="css-value"> 12px</span></span>;
}
span {
	<span class="css-property">float<span class="css-selector">:</span><span class="css-value"> left</span></span>;
	<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 6px 8px 6px 8px</span></span>;
}
.nav_bar {
	<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 230px</span></span>;
	<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 0 auto</span></span>;
}
.nav_bar ul {
	<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
	<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
	<span class="css-property">list-style<span class="css-selector">:</span><span class="css-value"> none</span></span>;
}
.nav_bar li {
	<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #f5f5f5</span></span>;
	<span class="css-property">cursor<span class="css-selector">:</span><span class="css-value"> pointer</span></span>;
	<span class="css-property">font-weight<span class="css-selector">:</span><span class="css-value"> bold</span></span>;
	<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 130px</span></span>;
	<span class="css-property">overflow<span class="css-selector">:</span><span class="css-value"> hidden</span></span>;
	<span class="css-property">max-height<span class="css-selector">:</span><span class="css-value"> 26px</span></span>;
}
.whole {
	<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #f5f5f5</span></span>;
	<span class="css-property">margin-left<span class="css-selector">:</span><span class="css-value"> 50px</span></span>;
	<span class="css-property">font-weight<span class="css-selector">:</span><span class="css-value"> normal</span></span>;
	<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 150px</span></span>;
}</span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/02/jquery-growing-menu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Use PHP to show a part of your text</title>
		<link>http://www.rrpowered.com/2012/01/use-php-to-show-a-part-of-your-text/</link>
		<comments>http://www.rrpowered.com/2012/01/use-php-to-show-a-part-of-your-text/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 06:37:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[substr]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=491</guid>
		<description><![CDATA[Use PHP to show only a part of your text by adding “…” to the end of your message after 10 characters. We&#8217;re gonna start with our text in a variable. 1 2 3 4 5 6 7 $message=&#34;Lorem ipsum &#8230; <a href="http://www.rrpowered.com/2012/01/use-php-to-show-a-part-of-your-text/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Use PHP to show only a part of your text by adding “…” to the end of your message after 10 characters.</h5>
<p><a href="http://www.rrpowered.com/2012/01/use-php-to-show-a-part-of-your-text/" class="image-post"><img src="http://www.rrpowered.com/images/short.png" alt="" class="post-img" /></a><br />
<span id="more-491"></span><br />
We&#8217;re gonna start with our text in a variable.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre>
<pre><span class="php"><span class="php-var">$message</span><span class="php-operator">=</span><span class="php-string">&quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam in erat
nec lacus condimentum hendrerit. Vestibulum fringilla ornare augue ut sagittis.
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
egestas. Vivamus urna nibh, tristique a suscipit sit amet, tempus vitae lectus.&quot;</span>;</span></pre>
</div>
<p><b>Okay here we go!!!</b><br />
We use the PHP function <b>strlen()</b> to get the length of the text in our variable. Then use the PHP function <b>substr()</b> to only shoe the first 10 characters from the text in our variable. </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
<pre><span class="php"><span class="php-var">$VarLength</span> <span class="php-operator">=</span> <span class="php-function">strlen</span><span class="php-brackets">(</span><span class="php-var">$message</span><span class="php-brackets">)</span>;
<span class="php-comment">//The length set to 10
</span>
<span class="php-keyword">if</span> <span class="php-brackets">(</span><span class="php-var">$VarLength</span> <span class="php-operator">&gt;</span> <span class="php-number">1</span><span class="php-number">0</span><span class="php-brackets">)</span> <span class="php-brackets">{</span>
<span class="php-comment">/*Add &quot;...&quot; after 10 charecters*/</span>
<span class="php-var">$message</span> <span class="php-operator">=</span> <span class="php-function">substr</span><span class="php-brackets">(</span><span class="php-var">$message</span>,<span class="php-number">0</span>,<span class="php-number">1</span><span class="php-number">0</span><span class="php-brackets">)</span> <span class="php-operator">.</span> <span class="php-string">&quot;...&quot;</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">echo</span> <span class="php-var">$message</span>;</span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/01/use-php-to-show-a-part-of-your-text/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>jQuery plugin get variable from plugin</title>
		<link>http://www.rrpowered.com/2012/01/jquery-plugin-get-variable-from-plugin/</link>
		<comments>http://www.rrpowered.com/2012/01/jquery-plugin-get-variable-from-plugin/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 02:55:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Plugin variable]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=325</guid>
		<description><![CDATA[Today I will show you how to get a variable from your plugin. Lets say you want to know what a variable is that was passing to your plugin. What we have here is the the plugin called myplugin with &#8230; <a href="http://www.rrpowered.com/2012/01/jquery-plugin-get-variable-from-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Today I will show you how to get a variable from your plugin. Lets say you want to know what a variable is that was passing to your plugin.</h5>
<p><a href="http://www.rrpowered.com/2012/01/jquery-plugin-get-variable-from-plugin/" class="image-post"><img src="http://www.rrpowered.com/images/pg.png" alt="" class="post-img" /></a><br />
<span id="more-325"></span><br />
What we have here is the the plugin called <b>myplugin</b> with a <b>function(callback)</b> </p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre><span class="js">$<span class="js-bracket">(</span><span class="js-string">&quot;#test-div&quot;</span><span class="js-bracket">)</span>.myplugin<span class="js-bracket">(</span>
<span class="js-function-keyword">function</span><span class="js-bracket">(</span>callback<span class="js-bracket">)</span><span class="js-bracket">{</span>
<span class="js-reserved-keyword">if</span><span class="js-bracket">(</span>callback <span class="js-operator">=</span><span class="js-operator">=</span> <span class="js-number">1</span><span class="js-bracket">)</span><span class="js-bracket">{</span>
<span class="js-client-keyword">alert</span><span class="js-bracket">(</span><span class="js-string">&quot;test variable equals 1&quot;</span><span class="js-bracket">)</span>;
<span class="js-bracket">}</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span>;</span></pre>
</div>
<p><b>The plugin</b><br />
Ok, here is the plugin.<br />
Now to send a variable back to our plugin call. We set a variable called <b>testvariable</b>. Then we create a function called <b>callback</b> with the variable <b>testvariable</b>.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre><span class="js"><span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span>$<span class="js-bracket">)</span><span class="js-bracket">{</span>
$.fn.myplugin <span class="js-operator">=</span> <span class="js-function-keyword">function</span><span class="js-bracket">(</span>callback<span class="js-bracket">)</span><span class="js-bracket">{</span>
<span class="js-reserved-keyword">var</span> testvariable<span class="js-operator">=</span><span class="js-number">1</span>;
callback<span class="js-bracket">(</span>testvariable<span class="js-bracket">)</span>;
<span class="js-bracket">}</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span><span class="js-bracket">(</span>jQuery<span class="js-bracket">)</span>;</span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/01/jquery-plugin-get-variable-from-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Time Ago</title>
		<link>http://www.rrpowered.com/2012/01/php-time-ago/</link>
		<comments>http://www.rrpowered.com/2012/01/php-time-ago/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 21:34:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Ago]]></category>
		<category><![CDATA[Time]]></category>
		<category><![CDATA[Time Ago]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=469</guid>
		<description><![CDATA[A simple way to display ago with UNIX time. Displaying the time ago. To display the time ago. Just add this where you want to display the time ago. 1 2 3 4 5 6 7 8 9 10 11 &#8230; <a href="http://www.rrpowered.com/2012/01/php-time-ago/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>A simple way to display ago with UNIX time.</h5>
<p><a href="http://www.rrpowered.com/2012/01/php-time-ago/" class="image-post"><img src="http://www.rrpowered.com/images/phpago.png" alt="" class="post-img" /></a><br />
<span id="more-469"></span><br />
<b>Displaying the time ago.</b><br />
To display the time ago. Just add this where you want to display the time ago.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?</span>PHP
<span class="php-comment">/*Created by Barrett at RRPowered.com*/</span>
<span class="php-keyword">include_once</span><span class="php-brackets">(</span><span class="php-string">'ago.php'</span><span class="php-brackets">)</span>;<span class="php-comment">//Include the ago.php file
</span>
<span class="php-var">$cur_time1</span> <span class="php-operator">=</span><span class="php-string">&quot;1291684422&quot;</span>;<span class="php-comment">//Your Unix time from database
</span>
<span class="php-keyword">echo</span> time_ago<span class="php-brackets">(</span><span class="php-var">$cur_time1</span><span class="php-brackets">)</span> ;
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>&nbsp;<br />
<br />
<b>Here is the PHP file!</b><br />
This file is called <b>ago.php</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?</span>PHP
<span class="php-comment">/*Created by Barrett at RRPowered.com*/</span>
<span class="php-comment">//Call the function
</span>
<span class="php-function">function</span> time_ago<span class="php-brackets">(</span><span class="php-var">$cur_time</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
<span class="php-var">$time_</span> <span class="php-operator">=</span> <span class="php-function">time</span><span class="php-brackets">(</span><span class="php-brackets">)</span> <span class="php-operator">-</span> <span class="php-var">$cur_time</span>;

<span class="php-var">$seconds</span> <span class="php-operator">=</span><span class="php-var">$time_</span>;
<span class="php-var">$minutes</span> <span class="php-operator">=</span> <span class="php-function">round</span><span class="php-brackets">(</span><span class="php-var">$time_</span> <span class="php-operator">/</span> <span class="php-number">6</span><span class="php-number">0</span><span class="php-brackets">)</span>;
<span class="php-var">$hours</span> <span class="php-operator">=</span> <span class="php-function">round</span><span class="php-brackets">(</span><span class="php-var">$time_</span> <span class="php-operator">/</span> <span class="php-number">3</span><span class="php-number">6</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>;
<span class="php-var">$days</span> <span class="php-operator">=</span> <span class="php-function">round</span><span class="php-brackets">(</span><span class="php-var">$time_</span> <span class="php-operator">/</span> <span class="php-number">8</span><span class="php-number">6</span><span class="php-number">4</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>;
<span class="php-var">$weeks</span> <span class="php-operator">=</span> <span class="php-function">round</span><span class="php-brackets">(</span><span class="php-var">$time_</span> <span class="php-operator">/</span> <span class="php-number">6</span><span class="php-number">0</span><span class="php-number">4</span><span class="php-number">8</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>;
<span class="php-var">$months</span> <span class="php-operator">=</span> <span class="php-function">round</span><span class="php-brackets">(</span><span class="php-var">$time_</span> <span class="php-operator">/</span> <span class="php-number">2</span><span class="php-number">4</span><span class="php-number">1</span><span class="php-number">9</span><span class="php-number">2</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>;
<span class="php-var">$years</span> <span class="php-operator">=</span> <span class="php-function">round</span><span class="php-brackets">(</span><span class="php-var">$time_</span> <span class="php-operator">/</span> <span class="php-number">2</span><span class="php-number">9</span><span class="php-number">0</span><span class="php-number">3</span><span class="php-number">0</span><span class="php-number">4</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>;

<span class="php-comment">//Seconds
</span>
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$seconds</span> <span class="php-operator">&lt;</span><span class="php-operator">=</span> <span class="php-number">6</span><span class="php-number">0</span><span class="php-brackets">)</span><span class="php-brackets">{</span>

   <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$seconds seconds ago&quot;</span>;   

<span class="php-comment">//Minutes
</span>
<span class="php-brackets">}</span><span class="php-keyword">else</span> <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$minutes</span> <span class="php-operator">&lt;</span><span class="php-operator">=</span> <span class="php-number">6</span><span class="php-number">0</span><span class="php-brackets">)</span><span class="php-brackets">{</span>

   <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$minutes</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
   <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;one minute ago&quot;</span>;
   <span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
   <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$minutes minutes ago&quot;</span>;
   <span class="php-brackets">}</span>

<span class="php-comment">//Hours
</span>
<span class="php-brackets">}</span><span class="php-keyword">else</span> <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$hours</span> <span class="php-operator">&lt;</span><span class="php-operator">=</span> <span class="php-number">2</span><span class="php-number">4</span><span class="php-brackets">)</span><span class="php-brackets">{</span>

  <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$hours</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;one hour ago&quot;</span>;
  <span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$hours hours ago&quot;</span>;
  <span class="php-brackets">}</span>

<span class="php-comment">//Days
</span>
<span class="php-brackets">}</span><span class="php-keyword">else</span> <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$days</span> <span class="php-operator">&lt;</span><span class="php-operator">=</span> <span class="php-number">7</span><span class="php-brackets">)</span><span class="php-brackets">{</span>

   <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$days</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
   <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;one day ago&quot;</span>;
   <span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
   <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$days days ago&quot;</span>;
   <span class="php-brackets">}</span>

<span class="php-comment">//Weeks
</span>
<span class="php-brackets">}</span><span class="php-keyword">else</span> <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$weeks</span> <span class="php-operator">&lt;</span><span class="php-operator">=</span> <span class="php-number">4</span><span class="php-brackets">)</span><span class="php-brackets">{</span>

  <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$weeks</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;one week ago&quot;</span>;
  <span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$weeks weeks ago&quot;</span>;
  <span class="php-brackets">}</span>

<span class="php-comment">//Months
</span>
<span class="php-brackets">}</span><span class="php-keyword">else</span> <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$months</span> <span class="php-operator">&lt;</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-number">2</span><span class="php-brackets">)</span><span class="php-brackets">{</span>

  <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$months</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;one month ago&quot;</span>;
  <span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$months months ago&quot;</span>;
  <span class="php-brackets">}</span>

<span class="php-comment">//Years
</span>
<span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>  

  <span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$year</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;one year ago&quot;</span>;
  <span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
  <span class="php-var">$time</span><span class="php-operator">=</span><span class="php-string">&quot;$year years ago&quot;</span>;
  <span class="php-brackets">}</span>  

<span class="php-brackets">}</span>
<span class="php-keyword">return</span> <span class="php-var">$time</span>;
<span class="php-brackets">}</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/01/php-time-ago/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Check If A Users Picture Exists Using PHP</title>
		<link>http://www.rrpowered.com/2012/01/check-if-a-users-picture-exists-using-php/</link>
		<comments>http://www.rrpowered.com/2012/01/check-if-a-users-picture-exists-using-php/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 05:03:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Check]]></category>
		<category><![CDATA[Check If users Picture Exists]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Users image]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=464</guid>
		<description><![CDATA[Today We will use PHP to check if a users picture exists. Let&#8217;s get started! First We set the users and default picture location into a variable. Next We check if the users picture exists. If the users picture exists &#8230; <a href="http://www.rrpowered.com/2012/01/check-if-a-users-picture-exists-using-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Today We will use PHP to check if a users picture exists.</h5>
<p><a href="http://www.rrpowered.com/2012/01/check-if-a-users-picture-exists-using-php/" class="image-post"><img src="http://www.rrpowered.com/images/checkpic.png" alt="" class="post-img" /></a><br />
<span id="more-464"></span><br />
<b>Let&#8217;s get started!</b><br />
First We set the users and default picture location into a variable. Next We check if the users picture exists. If the users picture exists We will display it. If not We show the default picture.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre>
<pre><span class="php"><span class="php-comment">/*The location to the default picture*/</span>
<span class="php-var">$no_picture</span><span class="php-operator">=</span><span class="php-string">&quot;default.jpg&quot;</span>;

<span class="php-comment">/*The location to the users picture*/</span>
<span class="php-var">$picture</span><span class="php-operator">=</span><span class="php-string">&quot;$user/picture.jpg&quot;</span>;

<span class="php-comment">/*We will use the PHP file_exists function*/</span>
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-function">file_exists</span><span class="php-brackets">(</span><span class="php-var">$picture</span><span class="php-brackets">)</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
<span class="php-comment">/*If users picture exists show it*/</span>
<span class="php-var">$pic</span><span class="php-operator">=</span><span class="php-string">'&lt;img src=&quot;'</span><span class="php-operator">.</span><span class="php-var">$picture</span><span class="php-operator">.</span><span class="php-string">'&quot; alt=&quot;&quot; /&gt;'</span>;
<span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
<span class="php-comment">/*If users picture dose not exists shoe default picture instead*/</span>
<span class="php-var">$pic</span><span class="php-operator">=</span><span class="php-string">'&lt;img src=&quot;'</span><span class="php-operator">.</span><span class="php-var">$no_picture</span><span class="php-operator">.</span><span class="php-string">'&quot; alt=&quot;&quot; /&gt;'</span>;
<span class="php-brackets">}</span>

<span class="php-comment">/*Usage*/</span>
<span class="php-keyword">echo</span> <span class="php-var">$pic</span></span></pre>
</div>
<p>&nbsp;<br />
<br />
<b>Used in a function</b><br />
We can also put it in a Function. Like this!</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre>
<pre><span class="php"><span class="php-function">function</span> UserPic<span class="php-brackets">(</span><span class="php-var">$user</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
<span class="php-comment">/*The location to the default picture*/</span>

<span class="php-var">$no_picture</span><span class="php-operator">=</span><span class="php-string">&quot;default.jpg&quot;</span>;
<span class="php-comment">/*The location to the users picture*/</span>
<span class="php-var">$picture</span><span class="php-operator">=</span><span class="php-string">&quot;$user/picture.jpg&quot;</span>;

<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-function">file_exists</span><span class="php-brackets">(</span><span class="php-var">$picture</span><span class="php-brackets">)</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
<span class="php-var">$pic</span><span class="php-operator">=</span><span class="php-string">'&lt;img src=&quot;'</span><span class="php-operator">.</span><span class="php-var">$picture</span><span class="php-operator">.</span><span class="php-string">'&quot; alt=&quot;&quot; /&gt;'</span>;
<span class="php-brackets">}</span><span class="php-keyword">else</span><span class="php-brackets">{</span>
<span class="php-var">$pic</span><span class="php-operator">=</span><span class="php-string">'&lt;img src=&quot;'</span><span class="php-operator">.</span><span class="php-var">$no_picture</span><span class="php-operator">.</span><span class="php-string">'&quot; alt=&quot;&quot; /&gt;'</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">return</span> <span class="php-var">$pic</span>;
<span class="php-brackets">}</span>

<span class="php-comment">/*Usage*/</span>
UserPic<span class="php-brackets">(</span><span class="php-var">$user</span><span class="php-brackets">)</span></span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2012/01/check-if-a-users-picture-exists-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Public API with PHP, jQuery and JSON</title>
		<link>http://www.rrpowered.com/2011/12/public-api-with-php-jquery-and-json/</link>
		<comments>http://www.rrpowered.com/2011/12/public-api-with-php-jquery-and-json/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 05:51:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Public API]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=452</guid>
		<description><![CDATA[Okay I&#8217;m gonna show you a simple way of creating a Public API using PHP, jQuery and JSON. Demo Let&#8217;s get started! First we need to include the connection to the database. This file will be called connection.php 1 2 &#8230; <a href="http://www.rrpowered.com/2011/12/public-api-with-php-jquery-and-json/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Okay I&#8217;m gonna show you a simple way of creating a Public API using PHP, jQuery and JSON.</h5>
<p><a href="http://www.rrpowered.com/2011/12/public-api-with-php-jquery-and-json/" class="image-post"><img src="http://www.rrpowered.com/images/publicapi.png" alt="" class="post-img" /></a><br />
<span id="more-452"></span><br />
<a href="http://www.rrpowered.com/code/RRPowered-PublicAPI.zip" alt="img" class="download">Demo</a><br />
<b>Let&#8217;s get started!</b><br />
First we need to include the connection to the database. This file will be called connection.php</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?</span>PHP
<span class="php-comment">/*Created by Barrett at RRPowered.com*/</span>
<span class="php-comment">/*PHP Public API*/</span>

<span class="php-comment">//Our connection to the database
</span>
<span class="php-function">mysql_connect</span><span class="php-brackets">(</span><span class="php-string">&quot;HOST_NAME&quot;</span>,<span class="php-string">&quot;USER_NAME&quot;</span>,<span class="php-string">&quot;PASSWORD&quot;</span><span class="php-brackets">)</span> OR DIE <span class="php-brackets">(</span><span class="php-function">mysql_error</span><span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;
<span class="php-function">mysql_select_db</span><span class="php-brackets">(</span><span class="php-string">&quot;DATABASE&quot;</span><span class="php-brackets">)</span> OR DIE <span class="php-brackets">(</span><span class="php-function">mysql_error</span><span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>
Now for the API. First we include the database connection file. Then we check if the function exists.<br />
Now that we checked if the function exists we call the passed function. What&#8217;s next? Creating the function it&#8217;s self. So we create a function called <b>allUsers()</b>. Select all users from the database,<br />
put them into an array then loop through them putting them into a single array. Now for the JSON, we use the PHP <b>json_encode()</b> function.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?</span>PHP
<span class="php-comment">/*Created by Barrett at RRPowered.com*/</span>
<span class="php-comment">/*PHP Public API*/</span>

<span class="php-comment">//Include the database connection
</span>
<span class="php-keyword">include</span><span class="php-brackets">(</span><span class="php-string">'connection.php'</span><span class="php-brackets">)</span>;

<span class="php-comment">//Now we check if the function exists
</span>
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-function">function_exists</span><span class="php-brackets">(</span><span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'method'</span><span class="php-brackets">]</span><span class="php-brackets">)</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
	<span class="php-comment">//Call the passed function
</span>
	<span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'method'</span><span class="php-brackets">]</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-brackets">}</span>

<span class="php-comment">//Here is the function to get
</span>
<span class="php-function">function</span> allUsers<span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
	<span class="php-comment">//Get all users from the database
</span>
	<span class="php-var">$sql_users</span><span class="php-operator">=</span><span class="php-function">mysql_query</span><span class="php-brackets">(</span><span class="php-string">&quot;SELECT * FROM users&quot;</span><span class="php-brackets">)</span> OR DIE <span class="php-brackets">(</span><span class="php-function">mysql_error</span><span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-brackets">)</span>;
	<span class="php-comment">//New array called users
</span>
	<span class="php-var">$users</span><span class="php-operator">=</span><span class="php-keyword">array</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
	<span class="php-comment">//Loop through each result and put each result into a single array
</span>
	<span class="php-keyword">while</span><span class="php-brackets">(</span><span class="php-var">$user</span><span class="php-operator">=</span><span class="php-function">mysql_fetch_array</span><span class="php-brackets">(</span><span class="php-var">$sql_users</span><span class="php-brackets">)</span><span class="php-brackets">)</span><span class="php-brackets">{</span>
	<span class="php-var">$users</span><span class="php-brackets">[</span><span class="php-brackets">]</span><span class="php-operator">=</span><span class="php-var">$user</span>;
	<span class="php-brackets">}</span>
	<span class="php-comment">//Set $users to json encode $users
</span>
	<span class="php-var">$users</span><span class="php-operator">=</span><span class="php-function">json_encode</span><span class="php-brackets">(</span><span class="php-var">$users</span><span class="php-brackets">)</span>;
	<span class="php-comment">//Okay here is the JSONP
</span>
	<span class="php-keyword">echo</span> <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'jsoncallback'</span><span class="php-brackets">]</span><span class="php-operator">.</span><span class="php-string">'('</span><span class="php-operator">.</span><span class="php-var">$users</span><span class="php-operator">.</span><span class="php-string">')'</span>;
<span class="php-brackets">}</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>&nbsp;<br />
<b>Now for the jQuery</b><br />
The url in the <b>$.getJSON()</b> function looks like<br />
<b>http://www.YOUR_WEBITE_ADDRESS.com/api.php?method=allUsers&#038;jsoncallback=?</b><br />
the method is set to <b>method=allUsers</b> and the jsoncallback set to <b>&#038;jsoncallback=?</b>.<br />
Now we loop through the result an display them in a DIV.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre>
<pre><span class="js">$<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
<span class="js-comment">/* we use the jQuery get json function to get data
from are API. The first parameter is the url of our
API file called api.php */</span>
    $.getJSON<span class="js-bracket">(</span><span class="js-string">&quot;http://www.YOUR_WEBITE_ADDRESS.com/api.php?method=allUsers&amp;jsoncallback=?&quot;</span>,
        <span class="js-function-keyword">function</span><span class="js-bracket">(</span>dataGet<span class="js-bracket">)</span> <span class="js-bracket">{</span>
	    <span class="js-reserved-keyword">for</span><span class="js-bracket">(</span>allUsers <span class="js-reserved-keyword">in</span> dataGet<span class="js-bracket">)</span> <span class="js-bracket">{</span>
	        <span class="js-reserved-keyword">var</span> user <span class="js-operator">=</span> dataGet<span class="js-bracket">[</span>allUsers<span class="js-bracket">]</span>;
		$<span class="js-bracket">(</span><span class="js-string">&quot;#output&quot;</span><span class="js-bracket">)</span>.append<span class="js-bracket">(</span>user.name <span class="js-operator">+</span> <span class="js-string">&quot;&lt;br /&gt;&quot;</span><span class="js-bracket">)</span>;
        <span class="js-bracket">}</span>
    <span class="js-bracket">}</span><span class="js-bracket">)</span>;
<span class="js-bracket">}</span><span class="js-bracket">)</span>;</span></pre>
</div>
<p>&nbsp;<br />
<b>Now for the final html</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre>
<pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span>
<span class="html-attribute">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html lang=<span class="html-attribute">&quot;en&quot;</span>&gt;</span>
    <span class="html-other-element">&lt;head&gt;</span>
	<span class="html-other-element">&lt;title&gt;</span>PHP Public API<span class="html-other-element">&lt;/title&gt;</span>
	<span class="html-comment">&lt;!-- Include the latest version of jQuery library --&gt;</span>
	<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;http://ajax.googleapis.com/
	ajax/libs/jquery/1.7.1/jquery.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
	<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
		$<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span> <span class="js-bracket">{</span>
		<span class="js-comment">/* we use the jQuery get json function to get data
		from are API. The first parameter is the url of our
		API file called api.php */</span>
		    $.getJSON<span class="js-bracket">(</span><span class="js-string">&quot;http://www.YOUR_WEBITE_ADDRESS.com/api.php?method=allUsers&amp;jsoncallback=?&quot;</span>,
		    <span class="js-function-keyword">function</span><span class="js-bracket">(</span>dataGet<span class="js-bracket">)</span> <span class="js-bracket">{</span>
	                <span class="js-reserved-keyword">for</span><span class="js-bracket">(</span>allUsers <span class="js-reserved-keyword">in</span> dataGet<span class="js-bracket">)</span> <span class="js-bracket">{</span>
			    <span class="js-reserved-keyword">var</span> user <span class="js-operator">=</span> dataGet<span class="js-bracket">[</span>allUsers<span class="js-bracket">]</span>;
			    $<span class="js-bracket">(</span><span class="js-string">&quot;#output&quot;</span><span class="js-bracket">)</span>.append<span class="js-bracket">(</span>user.name <span class="js-operator">+</span> <span class="js-string">&quot;&lt;br /&gt;&quot;</span><span class="js-bracket">)</span>;
			<span class="js-bracket">}</span>
		    <span class="js-bracket">}</span><span class="js-bracket">)</span>;
		<span class="js-bracket">}</span><span class="js-bracket">)</span>;
        </span></span>&lt;/script&gt;</span>
    <span class="html-other-element">&lt;/head&gt;</span>
    <span class="html-other-element">&lt;body&gt;</span>
	<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;output&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
   <span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2011/12/public-api-with-php-jquery-and-json/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Animated header background with jQuery</title>
		<link>http://www.rrpowered.com/2011/12/animated-header-background-with-jquery/</link>
		<comments>http://www.rrpowered.com/2011/12/animated-header-background-with-jquery/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 21:01:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Animated]]></category>
		<category><![CDATA[Animated Header]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Header]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.rrpowered.com/?p=413</guid>
		<description><![CDATA[Today I’m gonna show you how to make an awesome animate header, using jQuery and CSS. View it in action in the video below. Watch in full screen for best results. &#160; Demo Demo lets get started. The first things &#8230; <a href="http://www.rrpowered.com/2011/12/animated-header-background-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h5>Today I’m gonna show you how to make an awesome animate header, using jQuery and CSS.</h5>
<p><a href="http://www.rrpowered.com/2011/12/animated-header-background-with-jquery/" class="image-post"><img src="http://www.rrpowered.com/images/headeranimated.png" alt="" class="post-img" /></a><br />
<span id="more-413"></span><br />
<![if !IE]></p>
<div class="video-outline">
<b>View it in action in the video below.</b></p>
<div class="video-js-box vim-css" id="videoz">
    <video class="video-js" width="600" height="260" controls preload poster="http://www.rrpowered.com/images/rrvideo.png"><br />
      <source src="http://rrpowered.com/demo/animatedheader/animatedheader.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' /><br />
      <source src="http://rrpowered.com/demo/animatedheader/animatedheader.mp4" type='video/webm; codecs="vp8, vorbis"' /><br />
      <source src="http://rrpowered.com/demo/animatedheader/animatedheader.mp4" type='video/ogg; codecs="theora, vorbis"' /><br />
    </video>
  </div>
<p>
<div class="video-green">Watch in full screen for best results.</div>
</div>
<p><![endif]><br />
&nbsp;<br />
<a href="http://www.rrpowered.com/demo/animatedheader/" alt="img" class="demo">Demo</a><br />
<a href="http://www.rrpowered.com/code/RRPowered-animatedheader.zip" alt="img" class="download">Demo</a><br />
<b>lets get started.</b><br />
The first things we have are the options for are background, the <b>scrollSpeed</b> for how fast the background image moves, the <b>step</b> is for the pixel movement per step, the <b>current</b> set to 0, the <b>imageHeight</b> this is the height of our background image, the <b>HeaderHeight</b> for how high we want our header to be.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
</pre>
<pre><span class="js"><span class="js-reserved-keyword">var</span> scrollSpeed <span class="js-operator">=</span> <span class="js-number">1</span><span class="js-number">5</span>;       <span class="js-comment">// Speed in milliseconds
</span>
            <span class="js-reserved-keyword">var</span> step <span class="js-operator">=</span> <span class="js-number">1</span>;               <span class="js-comment">// How many pixels to move per step
</span>
            <span class="js-reserved-keyword">var</span> current <span class="js-operator">=</span> <span class="js-number">0</span>;            <span class="js-comment">// The current pixel row
</span>
            <span class="js-reserved-keyword">var</span> imageHeight <span class="js-operator">=</span> <span class="js-number">4</span><span class="js-number">3</span><span class="js-number">0</span><span class="js-number">0</span>;     <span class="js-comment">// Height of the background image
</span>
            <span class="js-reserved-keyword">var</span> headerHeight <span class="js-operator">=</span> <span class="js-number">3</span><span class="js-number">0</span><span class="js-number">0</span>;     <span class="js-comment">// Header hight
</span>

            <span class="js-comment">//The pixel row where to start a new loop
</span>
            <span class="js-reserved-keyword">var</span> restartPosition <span class="js-operator">=</span> <span class="js-operator">-</span><span class="js-bracket">(</span>imageHeight <span class="js-operator">-</span> headerHeight<span class="js-bracket">)</span>;

            <span class="js-function-keyword">function</span> scrollBg<span class="js-bracket">(</span><span class="js-bracket">)</span><span class="js-bracket">{</span>

                <span class="js-comment">//Go to next pixel row.
</span>
                current <span class="js-operator">-</span><span class="js-operator">=</span> step;

                <span class="js-comment">//If at the end of the image, then go to the top.
</span>
                <span class="js-reserved-keyword">if</span> <span class="js-bracket">(</span>current <span class="js-operator">=</span><span class="js-operator">=</span> restartPosition<span class="js-bracket">)</span><span class="js-bracket">{</span>
                    current <span class="js-operator">=</span> <span class="js-number">0</span>;
                <span class="js-bracket">}</span>
                <span class="js-comment">//Set the CSS position of the header.
</span>
                $<span class="js-bracket">(</span><span class="js-string">&quot;#header&quot;</span><span class="js-bracket">)</span>.css<span class="js-bracket">(</span><span class="js-string">&quot;background-position&quot;</span>,<span class="js-string">&quot;0 &quot;</span><span class="js-operator">+</span>current<span class="js-operator">+</span><span class="js-string">&quot;px&quot;</span><span class="js-bracket">)</span>;

            <span class="js-bracket">}</span>

            <span class="js-comment">//Calls the scrolling function repeatedly
</span>
            <span class="js-reserved-keyword">var</span> init <span class="js-operator">=</span> <span class="js-native-keyword">setInterval</span><span class="js-bracket">(</span><span class="js-string">&quot;scrollBg()&quot;</span>, scrollSpeed<span class="js-bracket">)</span>;</span></pre>
</div>
<p>&nbsp;<br />
<b>Now the CSS.</b><br />
 We just set the height and background image that we want.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre>
<pre><span class="js">#header<span class="js-bracket">{</span>
            height<span class="js-operator">:</span> <span class="js-number">3</span><span class="js-number">0</span><span class="js-number">0</span>px;
            background<span class="js-operator">:</span> url<span class="js-bracket">(</span><span class="js-string">'bg.jpg'</span><span class="js-bracket">)</span> repeat<span class="js-operator">-</span>y <span class="js-client-keyword">scroll</span> left top;
            <span class="js-bracket">}</span></span></pre>
</div>
<p><b>Ok the HTML setup.</b><br />
Just one div is all we need.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre><span class="html"><span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;header&quot;</span>&gt;</span>
            <span class="html-other-element">&lt;h1&gt;</span>Animated Header<span class="html-other-element">&lt;/h1&gt;</span>
        <span class="html-other-element">&lt;/div&gt;</span></span></pre>
</div>
<p><b>Now put it all together.</b></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
</pre>
<pre><span class="html"><span class="html-comment">&lt;!-- Created by Barrett at RRPowered --&gt;</span>
<span class="html-other-element">&lt;!DOCTYPE html&gt;</span>
<span class="html-other-element">&lt;html lang=<span class="html-attribute">&quot;en&quot;</span>&gt;</span>
    <span class="html-other-element">&lt;head&gt;</span>
        <span class="html-other-element">&lt;meta charset=<span class="html-attribute">&quot;UTF-8&quot;</span> /&gt;</span>
        <span class="html-other-element">&lt;title&gt;</span>Animated header background with jQuery<span class="html-other-element">&lt;/title&gt;</span>
        <span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;http://ajax.googleapis.com/ajax/
libs/jquery/1.7.1/jquery.min.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
        <span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
            <span class="js-reserved-keyword">var</span> scrollSpeed <span class="js-operator">=</span> <span class="js-number">1</span><span class="js-number">5</span>;       <span class="js-comment">// Speed in milliseconds
</span>
            <span class="js-reserved-keyword">var</span> step <span class="js-operator">=</span> <span class="js-number">1</span>;               <span class="js-comment">// How many pixels to move per step
</span>
            <span class="js-reserved-keyword">var</span> current <span class="js-operator">=</span> <span class="js-number">0</span>;            <span class="js-comment">// The current pixel row
</span>
            <span class="js-reserved-keyword">var</span> imageHeight <span class="js-operator">=</span> <span class="js-number">4</span><span class="js-number">3</span><span class="js-number">0</span><span class="js-number">0</span>;     <span class="js-comment">// Height of the background image
</span>
            <span class="js-reserved-keyword">var</span> headerHeight <span class="js-operator">=</span> <span class="js-number">3</span><span class="js-number">0</span><span class="js-number">0</span>;     <span class="js-comment">// Header hight
</span>

            <span class="js-comment">//The pixel row where to start a new loop
</span>
            <span class="js-reserved-keyword">var</span> restartPosition <span class="js-operator">=</span> <span class="js-operator">-</span><span class="js-bracket">(</span>imageHeight <span class="js-operator">-</span> headerHeight<span class="js-bracket">)</span>;

            <span class="js-function-keyword">function</span> scrollBg<span class="js-bracket">(</span><span class="js-bracket">)</span><span class="js-bracket">{</span>

                <span class="js-comment">//Go to next pixel row.
</span>
                current <span class="js-operator">-</span><span class="js-operator">=</span> step;

                <span class="js-comment">//If at the end of the image, then go to the top.
</span>
                <span class="js-reserved-keyword">if</span> <span class="js-bracket">(</span>current <span class="js-operator">=</span><span class="js-operator">=</span> restartPosition<span class="js-bracket">)</span><span class="js-bracket">{</span>
                    current <span class="js-operator">=</span> <span class="js-number">0</span>;
                <span class="js-bracket">}</span>
                <span class="js-comment">//Set the CSS position of the header.
</span>
                $<span class="js-bracket">(</span><span class="js-string">&quot;#header&quot;</span><span class="js-bracket">)</span>.css<span class="js-bracket">(</span><span class="js-string">&quot;background-position&quot;</span>,<span class="js-string">&quot;0 &quot;</span><span class="js-operator">+</span>current<span class="js-operator">+</span><span class="js-string">&quot;px&quot;</span><span class="js-bracket">)</span>;

            <span class="js-bracket">}</span>

            <span class="js-comment">//Calls the scrolling function repeatedly
</span>
            <span class="js-reserved-keyword">var</span> init <span class="js-operator">=</span> <span class="js-native-keyword">setInterval</span><span class="js-bracket">(</span><span class="js-string">&quot;scrollBg()&quot;</span>, scrollSpeed<span class="js-bracket">)</span>;
        </span></span>&lt;/script&gt;</span>
        <span class="html-style-element">&lt;style type=<span class="css-string">&quot;text/css&quot;</span>&gt;<span class="css"><span class="css">
            #header{
            <span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 300px</span></span>;
            <span class="css-property">background<span class="css-selector">:</span><span class="css-value"> url(<span class="css-string">'bg.jpg'</span>) repeat-y scroll left top</span></span>;
            }
        </span></span>&lt;/style&gt;</span>
    <span class="html-other-element">&lt;/head&gt;</span>
    <span class="html-other-element">&lt;body&gt;</span>
        <span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;header&quot;</span>&gt;</span>
            <span class="html-other-element">&lt;h1&gt;</span>Animated Header<span class="html-other-element">&lt;/h1&gt;</span>
        <span class="html-other-element">&lt;/div&gt;</span>
    <span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
<p>So now you can use this awesome animated header in your project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rrpowered.com/2011/12/animated-header-background-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://rrpowered.com/demo/animatedheader/animatedheader.mp4" length="1901546" type="video/mp4" />
		</item>
	</channel>
</rss>

