<?xml version="1.0" encoding="iso-8859-1"?>
<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>CrankBerry Blog &#187; Javascript</title>
	<atom:link href="http://www.crankberryblog.com/category/scripts-and-programming/javascript-programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.crankberryblog.com</link>
	<description>Sharing ideas on web design, development and the internet economy</description>
	<lastBuildDate>Thu, 24 Nov 2011 19:37:08 +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>crankSlider the Jquery DIV and Image Slider Script</title>
		<link>http://www.crankberryblog.com/2011/crankslider-the-jquery-div-and-image-slider-script</link>
		<comments>http://www.crankberryblog.com/2011/crankslider-the-jquery-div-and-image-slider-script#comments</comments>
		<pubDate>Mon, 30 May 2011 22:10:36 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=501</guid>
		<description><![CDATA[I was looking for a simple Jquery DIV slider the other day and took a while before I found anything but they were too heavy and clunky. I just decided the best way was to write my own. Sometimes you may want a slider for not just images but for Divs as well, that way you can include other elements inside the div or create more animations inside.

Without further ado head over here to grab the <a href="http://www.crankberryblog.com/tool/crank-slider.php">crankSlider Jquery Div and Image Slider</a>.]]></description>
			<content:encoded><![CDATA[<p>I was looking for a simple Jquery DIV slider the other day and took a while before I found anything but they were too heavy and clunky. I just decided the best way was to write my own. Sometimes you may want a slider for not just images but for Divs as well, that way you can include other elements inside the div or create more animations inside.</p>
<p>Without further ado head over here to grab the <a href="http://www.crankberryblog.com/tool/crank-slider.php">crankSlider Jquery Div and Image Slider</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2011/crankslider-the-jquery-div-and-image-slider-script/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The ultimate newb&#039;s guide to learning web development (Pt. 1: The Basic)</title>
		<link>http://www.crankberryblog.com/2010/the-ultimate-newbs-guide-to-learning-web-development-pt-1-the-basic</link>
		<comments>http://www.crankberryblog.com/2010/the-ultimate-newbs-guide-to-learning-web-development-pt-1-the-basic#comments</comments>
		<pubDate>Fri, 24 Sep 2010 22:22:21 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=406</guid>
		<description><![CDATA[If you are just discovering the world of web development but know nothing about HTML code, css and mumble-jumble, here's a good place to start. In this article I will outline in general where to find resources and some good skills to pick up on to becoming a minor expert in the field.]]></description>
			<content:encoded><![CDATA[<p>If you are just discovering the world of web development but know nothing about HTML code, css and mumble-jumble, here&#039;s a good place to start. In this article I will outline in general where to find resources and some good skills to pick up on to becoming a minor expert in the field.</p>
<p>To be honest, web development is all about practice and understanding, of course creativity as well (I&#039;ll get to this later). Here&#039;s a little scope about how I picked up on web development. I started making websites through FrontPage when I was 13, using only a bit of HTML and mainly the WYSIWYG (what you see is what you get) editor. It wasn&#039;t until I was 15 that I started developing with HTML and using CSS. When I was 18 I felt the need for more power in my websites which is when I picked up PHP and MySQL. About a year ago was finally when I started picking up on Javascript.</p>
<p>Basically, I learned everything through every resource except taking classes. I would search through the web, read books from the library or just pure trial and error. It wasn&#039;t insanely hard to gather all the information but the only times when I really learn was through projects and experiments. Web development is definitely a hands-on type of thing. Point is, if you want to learn web development you&#039;ll have to spend 30% reading and 70% doing.</p>
<h2>The Program/Software</h2>
<p>Web development can be accomplished through a few languages and most of them don&#039;t require any special software to write. The basic notepad that came with your Windows is capable of completing the task. I prefer to use a software that color codes coding to mitigate headaches. Here&#039;s a list of software that you could choose from.</p>
<ul>
<li><a href="http://notepad-plus-plus.org/" target="_blank">Notepad++ (Free)</a></li>
<li><a href="http://kompozer.net/" target="_blank">KompoZer (Free)</a></li>
<li><a href="http://www.w3.org/Amaya/" target="_blank">Amaya (Free)</a></li>
<li><a href="http://www.seamonkey-project.org/" target="_blank">SeaMonkey (Free)</a></li>
<li><a href="http://www.microsoft.com/expression/" target="_blank">Microsoft Expression Studio ($149)</a></li>
<li><a href="http://www.adobe.com/products/dreamweaver/" target="_blank">Adobe Dreamweaver ($399)</a></li>
</ul>
<p>I personally use Dreamweaver on my computer as I have been using it since I was young so I have a nostalgic feeling to it. When I&#039;m on the go I have notepad++ on my USB.</p>
<h2>Learning HTML</h2>
<p>Before you learn anything else, you have to be really good at HTML (hyper text markup language). The basic of websites all boils down to this language. HTML is the markup language containing markup tags that creates the webpage document. Every website requires HTML to make it work, yes even Flash websites.</p>
<p>Your basic website is wrapped in an opening and closing HTML tag. Opening tags are surrounded by arrow brackets while closing tags are the same but there&#039;s a front slash immediately after the first arrow bracket like such</p>
<div class="dean_ch" style="white-space: wrap;">&lt;html&gt;&lt;/html&gt;</div>
<p>Within the HTML tags there will be a HEAD and BODY tag. The head tags will describe items related to the website but will not be produced in the content. Items such as site title, meta tags, CSS, and Javascripts can be defined in the HEAD tag. The BODY tag will describe content that will be outputted to the user. A code like this:</p>
<div class="dean_ch" style="white-space: wrap;">&lt;html&gt;<br />
&lt;head&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;title&gt;Test Page&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Hello world!<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p>Will output &#034;Hello world!&#034; on the browser with the title Test Page in the browser title bar. Once you get this down you&#039;re ready to start building the website. The goal following this is to output the content you wish to show, it could be paragraphed text, images or tables. Everything you wished to use requires a markup tag to make it work. It&#039;ll be redundant for me to give you a tutorial on all the tags but here are two resources that are great.</p>
<ul>
<li><a href="http://www.w3schools.com/html/default.asp" target="_blank">w3school &#8211; HTML</a></li>
<li><a href="http://www.html.net/tutorials/html/" target="_blank">HTML.net</a></li>
</ul>
<p>w3school is great, as they are short writeups but concise so you can digest all of the content quickly. HTML.net is more detailed and a great read too but they incorporate a bit of CSS so its better to read it after w3school to cross-reference some of the ideas and undestanding. Once you&#039;ve got this down you&#039;re ready for some CSS.</p>
<h2>Learning CSS</h2>
<p>CSS (Cascading Style Sheet) is a language that focuses on the style and layout of your markup language. Its a common standard now generate the accurate aesthetic results of many websites. There are a few ways to include CSS in your website.</p>
<div class="dean_ch" style="white-space: wrap;">//Link to a CSS file &#8211; Goes in the &lt;head&gt;&lt;/head&gt; tag<br />
&lt;link href=&quot;css/styles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;</p>
<p>//Have the CSS in the &lt;head&gt;&lt;/head&gt; tag<br />
&lt;style type=&quot;text/css&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; .css { font-weight: bold; }<br />
&lt;/style&gt;</p>
<p>//Inline with content markup tags &#8211; in &lt;body&gt;&lt;/body&gt; tag<br />
&lt;p style=&quot;font-size: 22px;&quot;&gt;this is a paragraph&lt;/p&gt;<br />
&nbsp;</div>
<p>Once you have your website linked with some CSS you can start controlling your website. Here are some example of CSS controlling a webpage.</p>
<div class="dean_ch" style="white-space: wrap;">//All paragraph content will be bold and have a line height of 22 pixels<br />
p { font-weight: bold; line-height: 22px; }</p>
<p>//The following code will modify all markup tags with the class &quot;change&quot; to have a background color of black<br />
.change { background: #000; }</p>
<p>//The following code will modify the element with ID &quot;element_1&quot; to have a background color of white<br />
#element_1 { background: #FFF; }</div>
<p>Here are the resources to read to learn all about CSS.</p>
<ul>
<li><a href="http://www.w3schools.com/css/default.asp" target="_blank">w3school &#8211; CSS</a></li>
<li><a href="http://www.html.net/tutorials/css/" target="_blank">HTML.net</a></li>
</ul>
<p>Again its good to go over the basics with w3school first then head to HTML.net. </p>
<p>At this point you should practice making a few websites with HTML and CSS. Try to envision something and then build it. The best practice is to try to design something in Photoshop then try to build a web site from it. As I always tell developers, just design it and I&#039;ll make it into a template, because I don&#039;t believe there&#039;s many design limitations that can&#039;t be built with HTML and CSS. By doing this exercise it&#039;ll help you learn different methods of building different elements.</p>
<h2>Notes and Reminders</h2>
<p>There are some things you should keep in mind when building with HTML and CSS though.</p>
<h3>Using tables for design</h3>
<p>This is a no and not recommended. A lot of people argue over this topic. Some believe that tables are good for design because its easier to control and it holds the shape of the original design better. The problem is tables are clunky, heavy in coding and not very flexible. Tables have specific standards to them so if you have two rows and two columns, the columns have to be equal width while rows have to be equal height. In order to work around that you&#039;ll have to nest your tables, imagine dealing with that. Its also less flexible for future expansions. You should use a table for tabular data though. Extreme non-table believers will argue that you don&#039;t, they can produce the same effect with other elements. They sure can but when it comes down to the user extracting your data (copying to word or excel), copying for a table is much easier than anything else. It just makes sense.</p>
<h3>Avoid absolute positioning of everything</h3>
<p>Many developers when they start will notice the amount of control with absolute positioning. It is not until their design gets more complicated that it all falls apart. Absolute position provides more flexibility but will sometimes diminish your control, use wisely.</p>
<h3>Test in multiple browsers</h3>
<p>There are various browsers on the web. It sometimes depends on who your website caters to but mind as well cover the major users. Test on desktop machines with Internet Explorer 6, 7, 8, 9, Chrome, Firefox, Safari. On mobile devices with Android, Opera Mini, iOS. Just make sure everything&#039;s consistent. This is a good chance to test how good your skills are too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2010/the-ultimate-newbs-guide-to-learning-web-development-pt-1-the-basic/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awesome image cropper/thumbnail maker script &#8211; Modified Marquee Tool</title>
		<link>http://www.crankberryblog.com/2010/awesome-image-cropperthumbnail-maker-script-modified-marquee-tool</link>
		<comments>http://www.crankberryblog.com/2010/awesome-image-cropperthumbnail-maker-script-modified-marquee-tool#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:59:31 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Scripts]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Thumbnail]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=344</guid>
		<description><![CDATA[As I'm recoding my portfolio right now, I thought to myself - how great would it be to have a thumbnail maker tool. Some PHP or Javascript solution to crop images dynamically without the use of Photoshop. I would hate to fire up Photoshop every time I want to upload something. I'm sure you've all been there before. Anyways I landed upon a script that suited my need exactly. The <a href="http://marqueetool.net/">Rectangle Marquee Tool</a>. The tool looks great but was a bit confusing for me to get working and based on the comment for a few others too. Now I've also done some slight PHP modification to get the script working to my needs and generating the correct thumbnails. 

See what I'm mumbling on about right here:
<strong><a href="http://www.crankberryblog.com/demo/marqueetool/">Demonstration of Marquee Tool</a></strong>]]></description>
			<content:encoded><![CDATA[<p>As I&#039;m recoding my portfolio right now, I thought to myself &#8211; how great would it be to have a thumbnail maker tool. Some PHP or Javascript solution to crop images dynamically without the use of Photoshop. I would hate to fire up Photoshop every time I want to upload something. I&#039;m sure you&#039;ve all been there before. Anyways I landed upon a script that suited my need exactly. The <a href="http://marqueetool.net/">Rectangle Marquee Tool</a>. The tool looks great but was a bit confusing for me to get working and based on the comment for a few others too. Now I&#039;ve also done some slight PHP modification to get the script working to my needs and generating the correct thumbnails. </p>
<p>See what I&#039;m mumbling on about right here:<br />
<strong><a href="http://www.crankberryblog.com/demo/marqueetool/">Demonstration of Marquee Tool</a></strong></p>
<p><img src="http://www.crankberryblog.com/images/thumbnail-cropper-script.jpg" /></p>
<p>Once again I&#039;d like to clarify that I did not make the Rectangular Marquee Tool, it was written by Sergey Koksharov using certain functions of the Prototype/Scriptaculous framework. I&#039;m merely just doing some tweaks to make it work better in my circumstance. So all credits goes to Sergey and the Scriptaculous team.</p>
<p>My modification will allow you to do certain things such as:</p>
<ul>
<li>Define a input image dynamically</li>
<li>Define the output image dynamically</li>
<li>Generate a final output image</li>
</ul>
<p>I believe the PHP included in the original script was a bit dated so it wasn&#039;t working on my machine and servers that&#039;s why I made my own version.</p>
<p>So to start off you need to download the required files from: <a href="http://marqueetool.net/download/">here</a>. Then you need to extract the files into a scripts folder or whichever you prefer just remember to rename the source path after. The real files you need are:</p>
<ul>
<li>marker.css</li>
<li>prototype_reduced.js</li>
<li>rectmarquee.js</li>
</ul>
<p>Once you&#039;ve got the files extract them to the proper folders and create fresh PHP file to work with. This is the file your script will run from. I&#039;ll break down my code into chunks for you to understand, but I&#039;ll go in order so if you copy each chunk and paste them in the same order it should work. That is if you&#039;re reading this instruction right ;)</p>
<h3>Before the HTML</h3>
<p>So this piece of code starts off your whole document even before the HTML code. There&#039;s only two codes you need to modify which is the $img_src (original file) and $img_dst (final thumbnail file).</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span></p>
<p><span class="co1">//Source Image to Crop From</span><br />
<span class="re0">$img_src</span> = <span class="st0">&#039;img/&#039;</span>;</p>
<p><span class="co1">//Thumbnail Location</span><br />
<span class="re0">$img_dst</span> = <span class="st0">&#039;img/&#039;</span>;</p>
<p><span class="co1">//If you want to feed this dynamically you can use</span><br />
<span class="co1">//$_GET tags or draw them in through a database</span></p>
<p><span class="co1">//Some coding here not just for looks.</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$img_src</span>!=<span class="st0">&#034;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Check if Image</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Image Dimension</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!<a href="http://www.php.net/getimagesize"><span class="kw3">getimagesize</span></a><span class="br0">&#40;</span><span class="re0">$img_src</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Not A Valid Image</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$img_error</span> = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Getting Image Dimension</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$img_dim</span> = <a href="http://www.php.net/getimagesize"><span class="kw3">getimagesize</span></a><span class="br0">&#40;</span><span class="re0">$img_src</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Verfiy This Is An Image</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$img_verify</span> = @imagecreatefromjpeg<span class="br0">&#40;</span><span class="re0">$img_src</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!<span class="re0">$img_verify</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$img_error</span> = <span class="nu0">1</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Getting Dimensions</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$img_w</span> = imagesx<span class="br0">&#40;</span><span class="re0">$img_verify</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$img_h</span> = imagesy<span class="br0">&#40;</span><span class="re0">$img_verify</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$img_error</span> == <span class="nu0">1</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&#039;Not a valid image&#039;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exit"><span class="kw3">exit</span></a>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">?&gt;</span></div>
<h3>The HTML and HEAD Tags</h3>
<p>This is the code to begin your HTML tag and your chunk of HEAD tag. Note that if you didn&#039;t place your files in the same location you have to change the source path.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;html&gt;<br />
&lt;head&gt;</p>
<p>&lt;link rel=<span class="st0">&quot;stylesheet&quot;</span> type=<span class="st0">&quot;text/css&quot;</span> href=<span class="st0">&quot;css/marker.css&quot;</span> /&gt;</p>
<p>&lt;script type=<span class="st0">&quot;text/javascript&quot;</span> src=<span class="st0">&quot;scripts/prototype_reduced.js&quot;</span>&gt;&lt;/script&gt;<br />
&lt;script type=<span class="st0">&quot;text/javascript&quot;</span> src=<span class="st0">&quot;scripts/rectmarquee.js&quot;</span>&gt;&lt;/script&gt; </p>
<p>&lt;/head&gt;</p></div>
<h3>Your BODY and Closing HTML Tag</h3>
<p>So all that&#039;s left is the BODY tag. There&#039;s really no modification you need to do here except for the (don&#039;t paste this in your code in order):</p>
<div class="dean_ch" style="white-space: wrap;">coords: <span class="br0">&#123;</span>x1: <span class="nu0">0</span>, y1: <span class="nu0">0</span>, width: <span class="nu0">100</span>, height: <span class="nu0">50</span><span class="br0">&#125;</span></div>
<p>This line defines where the crop box starts and how big it should be. You can play around with it if you want. Anyways here&#039;s the coding (do paste this in).</p>
<div class="dean_ch" style="white-space: wrap;">&lt;body&gt;</p>
<p>&lt;script type=<span class="st0">&quot;text/javascript&quot;</span>&gt; &nbsp;<br />
<span class="kw2">var</span> MarqueeTool;</p>
<p><span class="kw2">function</span> onMarqueeUpdate<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> coords = MarqueeTool.getCoords<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#039;coord_x&#039;</span><span class="br0">&#41;</span>.value = coords.x1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#039;coord_y&#039;</span><span class="br0">&#41;</span>.value = coords.y1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#039;coord_w&#039;</span><span class="br0">&#41;</span>.value = coords.width;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">&#039;coord_h&#039;</span><span class="br0">&#41;</span>.value = coords.height;<br />
<span class="br0">&#125;</span></p>
<p>
<span class="kw2">function</span> onWindowLoad<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; MarqueeTool = <span class="kw2">new</span> Marquee<span class="br0">&#40;</span><span class="st0">&#039;sampleid&#039;</span>, <span class="br0">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; preview: <span class="st0">&#039;preview&#039;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; color: <span class="st0">&#039;#000&#039;</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity: <span class="nu0">0.45</span>, <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; coords: <span class="br0">&#123;</span>x1: <span class="nu0">0</span>, y1: <span class="nu0">0</span>, width: <span class="nu0">100</span>, height: <span class="nu0">50</span><span class="br0">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; MarqueeTool.setOnUpdateCallback<span class="br0">&#40;</span>onMarqueeUpdate<span class="br0">&#41;</span>;</p>
<p><span class="br0">&#125;</span> </p>
<p>Event.observe<span class="br0">&#40;</span>window, <span class="st0">&#039;load&#039;</span>, onWindowLoad<span class="br0">&#41;</span>; </p>
<p><span class="kw2">&lt;/script&gt;</span> </p>
<p>&lt;div style=<span class="st0">&quot;width: &lt;?php echo $img_w; ?&gt;; height: &lt;?php echo $img_h; ?&gt;; position: relative;&quot;</span>&gt;<br />
&nbsp; &nbsp; &lt;img src=<span class="st0">&quot;&lt;?php echo $img_src; ?&gt;&quot;</span> alt=<span class="st0">&quot;&quot;</span> id=<span class="st0">&quot;sampleid&quot;</span> /&gt; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;div id=<span class="st0">&quot;preview&quot;</span> style=<span class="st0">&quot;position: absolute; right: 10px; bottom: 10px; border: 2px solid #FFF;&quot;</span>&gt;&lt;/div&gt; <br />
&lt;/div&gt;</p>
<p>&lt;form name=<span class="st0">&quot;coordsform&quot;</span> action=<span class="st0">&quot;crop.php&quot;</span> target=<span class="st0">&quot;_blank&quot;</span> method=<span class="st0">&quot;get&quot;</span>&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;input type=<span class="st0">&quot;hidden&quot;</span> name=<span class="st0">&quot;img&quot;</span> value=<span class="st0">&quot;&lt;?php echo $img_src; ?&gt;&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;input type=<span class="st0">&quot;hidden&quot;</span> name=<span class="st0">&quot;img_dst&quot;</span> value=<span class="st0">&quot;&lt;?php echo $img_dst; ?&gt;&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;input type=<span class="st0">&quot;hidden&quot;</span> name=<span class="st0">&quot;x&quot;</span> value=<span class="st0">&quot;5&quot;</span> id=<span class="st0">&quot;coord_x&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;input type=<span class="st0">&quot;hidden&quot;</span> name=<span class="st0">&quot;y&quot;</span> value=<span class="st0">&quot;0&quot;</span> id=<span class="st0">&quot;coord_y&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;input type=<span class="st0">&quot;hidden&quot;</span> name=<span class="st0">&quot;w&quot;</span> value=<span class="st0">&quot;0&quot;</span> id=<span class="st0">&quot;coord_w&quot;</span> /&gt;<br />
&nbsp; &nbsp; &lt;input type=<span class="st0">&quot;hidden&quot;</span> name=<span class="st0">&quot;h&quot;</span> value=<span class="st0">&quot;0&quot;</span> id=<span class="st0">&quot;coord_h&quot;</span> /&gt;</p>
<p>&nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;input name=<span class="st0">&quot;submit&quot;</span> type=<span class="st0">&quot;submit&quot;</span> value=<span class="st0">&quot;Make Thumbnail&quot;</span>&gt;<br />
&lt;/form&gt; </p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</div>
<p>Now we&#039;re just about complete here. All this tool does right now is let you select an area to crop. To actually make the thumbnail you need the assistant of PHP (you can do it in JS but I prefer PHP). You need to have the GD library enabled in order for this to work. </p>
<p>At this point you need to create your last file which is named crop.php. All you need in crop.php is this:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span> </p>
<p><span class="co1">//Variables</span><br />
<span class="re0">$img_w</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#039;w&#039;</span><span class="br0">&#93;</span>;<br />
<span class="re0">$img_h</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#039;h&#039;</span><span class="br0">&#93;</span>;<br />
<span class="re0">$img_x</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#039;x&#039;</span><span class="br0">&#93;</span>;<br />
<span class="re0">$img_y</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#039;y&#039;</span><span class="br0">&#93;</span>;<br />
<span class="re0">$img_src</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#039;img&#039;</span><span class="br0">&#93;</span>;<br />
<span class="re0">$img_dst</span> = <span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">&#039;img_dst&#039;</span><span class="br0">&#93;</span>;</p>
<p><span class="co1">//There&#039;s a Set Thumb</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$img_w</span>&gt;<span class="nu0">0</span> &amp;&amp; <span class="re0">$img_h</span>&gt;<span class="nu0">0</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> </p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Create New Image</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$new_img</span> = imagecreatetruecolor<span class="br0">&#40;</span><span class="re0">$img_w</span>, <span class="re0">$img_h</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Loading The Original Image</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$old_img</span> = imagecreatefromjpeg<span class="br0">&#40;</span><span class="re0">$img_src</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Copying Image</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; imagecopy<span class="br0">&#40;</span><span class="re0">$new_img</span>, <span class="re0">$old_img</span>, <span class="nu0">0</span>, <span class="nu0">0</span>, <span class="re0">$img_x</span>, <span class="re0">$img_y</span>, <span class="re0">$img_w</span>, <span class="re0">$img_h</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">&quot;Content-Type: image/jpeg&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; @imagejpeg<span class="br0">&#40;</span><span class="re0">$new_img</span>, <span class="re0">$img_dst</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; imagejpeg<span class="br0">&#40;</span><span class="re0">$new_img</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Destroy the Old Images</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; imagedestroy<span class="br0">&#40;</span><span class="re0">$old_img</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; imagedestroy<span class="br0">&#40;</span><span class="re0">$new_img</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">?&gt;</span></div>
<p>That&#039;s it, and everything should work like planed. I&#039;ve tested this script out a few times but if anything doesn&#039;t work just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2010/awesome-image-cropperthumbnail-maker-script-modified-marquee-tool/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross Browser Friendly Div Tabs Script</title>
		<link>http://www.crankberryblog.com/2009/cross-browser-friendly-div-tabs-script</link>
		<comments>http://www.crankberryblog.com/2009/cross-browser-friendly-div-tabs-script#comments</comments>
		<pubDate>Sat, 14 Nov 2009 01:32:23 +0000</pubDate>
		<dc:creator>Jerry Low</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.crankberryblog.com/?p=287</guid>
		<description><![CDATA[For some reason modern designers and developers love to use tabs. Maybe they keep things organize and clean all in one page. Here's a incredibly simple cross browser compatible Javasript tabs script. The final result will look like the one below.

<img src="http://www.crankberryblog.com/images/javascript-tabs.jpg" />]]></description>
			<content:encoded><![CDATA[<p>For some reason modern designers and developers love to use tabs. Maybe they keep things organize and clean all in one page. Here&#039;s a incredibly simple cross browser compatible Javasript tabs script. The final result will look like the one below.</p>
<p><img src="http://www.crankberryblog.com/images/javascript-tabs.jpg" /></p>
<p><strong>Javascript</strong></p>
<p>Include this script either as a separate file or in between the head tags.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;script type=<span class="st0">&quot;text/javascript&quot;</span>&gt;</p>
<p>
<span class="co1">//Tab Selected</span><br />
<span class="kw2">function</span> show_content<span class="br0">&#40;</span>id<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Hide Content</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; hide_content<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Change Tab</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; change_tab<span class="br0">&#40;</span>id<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Strip Id</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> new_id = id.<span class="me1">replace</span><span class="br0">&#40;</span><span class="st0">&#039;tab_&#039;</span>, <span class="st0">&quot;&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span>new_id<span class="br0">&#41;</span>.<span class="me1">style</span>.<span class="me1">display</span> = <span class="st0">&quot;block&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> hide_content<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Hide Others</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> content_div = document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&#039;content_area&#039;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> content_inner = content_div.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span><span class="st0">&#039;DIV&#039;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> other_div = content_inner.<span class="me1">length</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>;i &lt; other_div; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; content_inner<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">style</span>.<span class="me1">display</span> = <span class="st0">&quot;none&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">function</span> change_tab<span class="br0">&#40;</span>id<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Change Others</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tab_div = document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&#039;tab_bar&#039;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> tab_inner = tab_div.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span><span class="st0">&#039;DIV&#039;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> other_tab = tab_inner.<span class="me1">length</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw2">var</span> i=<span class="nu0">0</span>; i &lt; other_tab; i++<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tab_inner<span class="br0">&#91;</span>i<span class="br0">&#93;</span>.<span class="me1">className</span> = <span class="st0">&quot;tab_button&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Last Tab Change</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span>id<span class="br0">&#41;</span>.<span class="me1">className</span> = <span class="st0">&quot;tab_button tab_button_sel&quot;</span>;<br />
<span class="br0">&#125;</span></p>
<p>&lt;/script&gt;</p></div>
<p><strong>CSS</strong></p>
<p>This is your CSS code that needs to also go between the HEAD tags or you can have a separate file once again.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;style type=<span class="st0">&quot;text/css&quot;</span>&gt;</p>
<p>body <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; font-family<span class="re2">:Arial</span>, Helvetica, <span class="kw2">sans-serif</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-size</span>: <span class="re3">12px</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.tab_area</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: <span class="re3">480px</span>;&nbsp; &nbsp;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.tab_bar</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">border</span>: <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">333</span></span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">border-left</span>: <span class="kw2">none</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">border-bottom</span>: <span class="kw2">none</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">float</span>: <span class="kw1">left</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">clear</span>: <span class="kw1">left</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.tab_button</span>&nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">border-left</span>: <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">333</span></span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="re0">#E8E8E8</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">padding</span>: <span class="re3">6px</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">float</span>: <span class="kw1">left</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">display</span>: <span class="kw2">inline</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">cursor</span>: <span class="kw2">pointer</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.tab_button_sel</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="kw2">none</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.tab_button</span><span class="re2">:hover</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">background</span>: <span class="re0">#CCC</span>;&nbsp; &nbsp; &nbsp; &nbsp;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.content_area</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">padding</span>: <span class="re3">6px</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: <span class="re3"><span class="nu0">100</span>%</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">float</span>: <span class="kw1">left</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">border</span>: <span class="re3">1px</span> <span class="kw2">solid</span> <span class="re0">#<span class="nu0">333</span></span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="re1">.tab_content</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">display</span>: <span class="kw2">none</span>;<br />
<span class="br0">&#125;</span></p>
<p>&lt;/style&gt;</p></div>
<p><strong>HTML</strong></p>
<p>This is your HTML code for the tabs, obviously you can customize this all you want to fit your content.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;div class=&quot;tab_area&quot;&gt;<br />
&nbsp; &nbsp; &lt;div class=&quot;tab_bar&quot; id=&quot;tab_bar&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tab_button&quot; id=&quot;tab_one&quot; onclick=&quot;show_content(this.id);&quot;&gt;Tab One&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tab_button&quot; id=&quot;tab_two&quot; onclick=&quot;show_content(this.id);&quot;&gt;Tab Two&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tab_button&quot; id=&quot;tab_three&quot; onclick=&quot;show_content(this.id);&quot;&gt;Tab Three&lt;/div&gt;<br />
&nbsp; &nbsp; &lt;/div&gt;<br />
&nbsp; &nbsp; &lt;div class=&quot;content_area&quot; id=&quot;content_area&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tab_content&quot; id=&quot;one&quot;&gt;Content Area One&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tab_content&quot; id=&quot;two&quot;&gt;Content Area Two&lt;/div&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&quot;tab_content&quot; id=&quot;three&quot;&gt;Content Area Three&lt;/div&gt;<br />
&nbsp; &nbsp; &lt;/div&gt;<br />
&lt;/div&gt;</div>
<p>The final tweak, lastly to ensure a default tab is selected from the beginning change your opening BODY tag to the following.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;body onload=&quot;show_content(&#039;tab_one&#039;);&quot;&gt;</div>
<h3>Adding Tabs and Content</h3>
<p>Ensure that you add the same amount of tabs as content or else there won&#039;t be enough tabs per content or vice-versa.</p>
<p><strong>Adding Tabs</strong></p>
<p>To add tabs just keep copying and pasting the following lines. Ensure the number of the id counts in order from 1, 2, 3&#8230; etc. You must have tab_ in front of the number.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;div class=&quot;tab_button&quot; id=&quot;tab_one&quot; onclick=&quot;show_content(this.id);&quot;&gt;Tab One&lt;/div&gt;<br />
&lt;div class=&quot;tab_button&quot; id=&quot;tab_two&quot; onclick=&quot;show_content(this.id);&quot;&gt;Tab Two&lt;/div&gt;<br />
&lt;div class=&quot;tab_button&quot; id=&quot;tab_three&quot; onclick=&quot;show_content(this.id);&quot;&gt;Tab Three&lt;/div&gt;</div>
<p><strong>Adding Contents</strong></p>
<p>Same thing with the content just keep on duplicating and name the id in sequence in terms of numbers.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;div class=&quot;tab_content&quot; id=&quot;one&quot;&gt;Content Area One&lt;/div&gt;<br />
&lt;div class=&quot;tab_content&quot; id=&quot;two&quot;&gt;Content Area Two&lt;/div&gt;<br />
&lt;div class=&quot;tab_content&quot; id=&quot;three&quot;&gt;Content Area Three&lt;/div&gt;</div>
<p>If you have any questions or trouble with this script just let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crankberryblog.com/2009/cross-browser-friendly-div-tabs-script/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

