<?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>Sandbox Development and Consulting Inc. &#187; Javascript</title>
	<atom:link href="http://www.sandboxdev.com/category/blog/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sandboxdev.com</link>
	<description>Building Solutions for Your Business Needs.</description>
	<lastBuildDate>Thu, 04 Mar 2010 16:44:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remove Initial Flicker With Smooth Gallery</title>
		<link>http://www.sandboxdev.com/blog/406/remove-initial-flicker-with-smooth-gallery/</link>
		<comments>http://www.sandboxdev.com/blog/406/remove-initial-flicker-with-smooth-gallery/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 01:51:50 +0000</pubDate>
		<dc:creator>jzelazny</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[SDAC Blog]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Smooth Gallery]]></category>

		<guid isPermaLink="false">http://www.sandboxdev.com/?p=406</guid>
		<description><![CDATA[<img src="http://www.sandboxdev.com/wordpress/wp-content/uploads/icons/w3c-small.gif" width="38" height="25" alt="" title="CSS" /><br/>I recently created a site (in beta testing now) with Smooth Gallery and the client loved it.  
The Problem:
The only issue was that upon the initial page load - all items in the gallery would flicker for a second or two while the first image loaded - causing this to not look professional at [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.sandboxdev.com/wordpress/wp-content/uploads/icons/w3c-small.gif" width="38" height="25" alt="" title="CSS" /><br/><p>I recently created a site (in beta testing now) with <a href="http://smoothgallery.jondesign.net/what/">Smooth Gallery</a> and the client loved it.  </p>
<p><strong>The Problem:</strong><br />
The only issue was that upon the initial page load - all items in the gallery would flicker for a second or two while the first image loaded - causing this to not look professional at all. </p>
<p><strong>The Solution:</strong></p>
<ol>
<li><strong>HTML:</strong> I took the example code:
<div class="igBar"><span id="lphp-3"><a href="#" onclick="javascript:showPlainTxt('php-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-3">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;div id=<span style="color:#FF0000;">"myGallery"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$featured_posts</span> = get_posts<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'numberposts=5&amp;order=DES&amp;orderby=date&amp;category=1'</span><span style="color:#006600; font-weight:bold;">&#41;</span>; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$i</span> = <span style="color:#CC66CC;color:#800000;">0</span>;foreach<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$featured_posts</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$post</span> <span style="color:#006600; font-weight:bold;">&#41;</span>: </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">setup_postdata<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$post</span><span style="color:#006600; font-weight:bold;">&#41;</span>;&nbsp; <span style="color:#0000FF;">$i</span>++;?&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&lt;div <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">"imageElement"</span> id=<span style="color:#FF0000;">"element&lt;?php echo $i;?&gt;"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;h3&gt;Item <span style="color:#CC66CC;color:#800000;">1</span> Title&lt;/h3&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;p&gt;Item <span style="color:#CC66CC;color:#800000;">1</span> Description&lt;/p&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;a href=<span style="color:#FF0000;">"#"</span> title=<span style="color:#FF0000;">"open image"</span> <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">"open"</span>&gt;&lt;/a&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;img src=<span style="color:#FF0000;">"images/brugges2006/1.jpg"</span> <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">"full"</span> /&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;img src=<span style="color:#FF0000;">"images/brugges2006/1-mini.jpg"</span> <span style="color:#000000; font-weight:bold;">class</span>=<span style="color:#FF0000;">"thumbnail"</span> /&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&lt;/div&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color:#000000; font-weight:bold;">&lt;?php</span> endforeach; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;&lt;/div&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
I then added an ID to each div (id="element1") so that each div had a class of "imageElement" and a unique ID (element1, element2, etc).
</li>
<li><strong>CSS:</strong> Now that I had IDs to style, I added the following to my style sheet:
<div class="igBar"><span id="lcss-4"><a href="#" onclick="javascript:showPlainTxt('css-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-4">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #cc00cc;">#element2 <span style="color: #66cc66;">&#123;</span></span>display: <span style="color: #993333;">none</span>;<span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<li>
</ol>
<p>By adding the 2 bits of code mentioned below, I was able to initially hide the content in the second div so that only the content in the first div appeared on page load.  Once the script started running, it then changed the display from none to block automatically.  Problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandboxdev.com/blog/406/remove-initial-flicker-with-smooth-gallery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Upgrade Google Analytic Tracker Code</title>
		<link>http://www.sandboxdev.com/blog/javascript/182/upgrade-google-analytic-tracker-code/</link>
		<comments>http://www.sandboxdev.com/blog/javascript/182/upgrade-google-analytic-tracker-code/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 21:56:52 +0000</pubDate>
		<dc:creator>jzelazny</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://www.sandboxdev.com/blog/javascript/2008/01/18/upgrade-google-analytic-tracker-code.php</guid>
		<description><![CDATA[<img src="http://www.sandboxdev.com/wordpress/wp-content/uploads/icons/sdac-small.gif" width="30" height="25" alt="" title="HOWTOs" /><br/>If you use Google Analytics on your web site, you should update your tracker code that is placed in your code. The new tracker is faster, and offers added tracking functionality (See Google's announcement)
New Code: (put your tracker ID in where you see the X's)
PLAIN TEXT
HTML:




&#60;script type="text/javascript" src="http://www.google-analytics.com/ga.js"&#62;&#60;/script&#62;


&#60;script type="text/javascript"&#62;


var pageTracker=_gat._getTracker('UA-XXXXXX-X');


pageTracker._initData();


pageTracker._trackPageview();


&#60;/script&#62; 






While you are updating your [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.sandboxdev.com/wordpress/wp-content/uploads/icons/sdac-small.gif" width="30" height="25" alt="" title="HOWTOs" /><br/><p>If you use <a href="http://www.google.com/analytics/">Google Analytics</a> on your web site, you should update your tracker code that is placed in your code. The new tracker is faster, and offers added tracking functionality (<a href="http://analytics.blogspot.com/2007/12/announcing-new-graphing-tools-gajs.html">See Google's announcement</a>)</p>
<p>New Code: (put your tracker ID in where you see the X's)</p>
<div class="igBar"><span id="lhtml-6"><a href="#" onclick="javascript:showPlainTxt('html-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-6">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span> <span style="color: #000066;">src</span>=<span style="color: #ff0000;">"http://www.google-analytics.com/ga.js"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/script.html"><span style="color: #000000; font-weight: bold;">&lt;script</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"text/javascript"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">var pageTracker=_gat._getTracker('UA-XXXXXX-X');</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pageTracker._initData();</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">pageTracker._trackPageview();</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>While you are updating your code, you might also want to <a href="http://developer.yahoo.net/blog/archives/2007/07/high_performanc_5.html">consider moving this and any other javascript</a> to the bottom of your web site for improved performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandboxdev.com/blog/javascript/182/upgrade-google-analytic-tracker-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terms of Use Javascript</title>
		<link>http://www.sandboxdev.com/blog/79/terms-of-use-javascript/</link>
		<comments>http://www.sandboxdev.com/blog/79/terms-of-use-javascript/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 23:37:55 +0000</pubDate>
		<dc:creator>jzelazny</dc:creator>
				<category><![CDATA[HOWTOs]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[SDAC Blog]]></category>

		<guid isPermaLink="false">http://www.sandboxdev.com/blog/2007/01/31/terms-of-use-javascript.php</guid>
		<description><![CDATA[<img src="http://www.sandboxdev.com/wordpress/wp-content/uploads/icons/sdac-small.gif" width="30" height="25" alt="" title="HOWTOs" /><br/>Need: A script that a client could easily call within a URL to force the users to agree to their terms of use before downloading a file.

Solution:Either put the following code in the header, or in a .js file to include:

PLAIN TEXT
JAVASCRIPT:




&#60;script type="text/javascript"&#62;


function terms&#40;&#41;&#123;


&#160; &#160; question = confirm&#40;"Terms of Use text here"&#41;


&#160;if &#40;question !="0"&#41;&#123;


&#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<img src="http://www.sandboxdev.com/wordpress/wp-content/uploads/icons/sdac-small.gif" width="30" height="25" alt="" title="HOWTOs" /><br/><p><strong>Need:</strong> A script that a client could easily call within a URL to force the users to agree to their terms of use before downloading a file.<br />
<br />
<strong>Solution:</strong>Either put the following code in the header, or in a .js file to include:<br />
<code>
<div class="igBar"><span id="ljavascript-9"><a href="#" onclick="javascript:showPlainTxt('javascript-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-9">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;script type=<span style="color: #3366CC;">"text/javascript"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> terms<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; question = <span style="color: #000066;">confirm</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"Terms of Use text here"</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>question !=<span style="color: #3366CC;">"0"</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; document.<span style="color: #006600;">URL</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/script&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></code></p>
<p>Then, call this code in your HTML code by using:<br />
<code>
<div class="igBar"><span id="lhtml-10"><a href="#" onclick="javascript:showPlainTxt('html-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-10">
<div class="html">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><a href="http://december.com/html/4/element/a.html"><span style="color: #000000; font-weight: bold;">&lt;a</span></a> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">"http://www.sandboxdev.com"</span> <span style="color: #000066;">onclick</span>=<span style="color: #ff0000;">"terms();return false;"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"Display Terms of Use"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span>Download Link<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sandboxdev.com/blog/79/terms-of-use-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
