<?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>WebDesign &#38; Such &#187; Javascript</title>
	<atom:link href="http://webdesignandsuch.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://webdesignandsuch.com</link>
	<description>a Beantown Design Production</description>
	<lastBuildDate>Thu, 29 Jul 2010 00:02:25 +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>Make the words in a Form Input disappear or be selected on click / focus.</title>
		<link>http://webdesignandsuch.com/2010/06/make-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus/</link>
		<comments>http://webdesignandsuch.com/2010/06/make-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 10:39:27 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[form select]]></category>
		<category><![CDATA[Form Styling]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=774</guid>
		<description><![CDATA[
			
				
			
		

Recently I was creating a contact form for a client&#8217;s website. Due to the fact that the form was in a rather small area, I didn&#8217;t have very much room for the text and inputs. See my solution below.
Usually I would write the name of the input followed by the input like this:
First Name:

Since I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fmake-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fmake-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/posts/clear-input/input-clear.jpg" title="clear a from input on select" class="alignnone" width="422" height="211" style="border:3px solid #000; margin:0 0 15px 0"/></p>
<p>Recently I was creating a contact form for a client&#8217;s website. Due to the fact that the form was in a rather small area, I didn&#8217;t have very much room for the text and inputs. See my solution below.</p>
<p>Usually I would write the name of the input followed by the input like this:</p>
<p style="color: #333; margin-bottom: 0px;"><strong>First Name:</strong></p>
<input style="background-color: #c3effc;" type="text" />
<p>Since I didn&#8217;t have room for that I had to come up with a solution.</p>
<p><span id="more-774"></span></p>
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">The first thing I thought was to add the name of the field as a <strong>value:</strong></p>
<input style="background-color: #c3effc;" type="text" value="First Name:" />
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">What I don&#8217;t like about that solution is that the user has to select the text manually, delete it, and then fill out the field. I wanted the text to disappear when the user clicked into the input. I looked around and figured it out; here&#8217;s how it looks / works finished:</p>
<input onfocus="this.value=''" style="background-color: #c3effc;" type="text" value="First Name:" />
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">All you need to do is add <strong>onfocus=&#34;this.value=&#39;&#39;&#34;</strong> to your input. So the code for this input looks like this:</p>
<div class="codeBox"><code>&lt;input onfocus="this.value=''" type="text" value="First Name:"  /&gt;</code></div>
<p style="padding-top: 15px; border-top: 1px dotted #ccc; margin-top: 25px;">Here&#8217;s one other similar technique that might come in handy. The following input selects the text on input, instead of clearing it.</p>
<input onfocus="this.select()" type="text" value="This text will be selected on click" style="background-color: #c3effc;"/>
<p>Here&#8217;s the code for that technique:</p>
<div class="codeBox">&lt;input onfocus=&#34;this.select()&#34; type=&#34;text&#34; value=&#34;write text here&#34; /&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/make-the-words-in-a-form-input-disappear-or-be-selected-on-click-focus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to refresh / reload a webpage with jQuery</title>
		<link>http://webdesignandsuch.com/2010/06/how-to-refresh-reload-a-webpage-with-jquery/</link>
		<comments>http://webdesignandsuch.com/2010/06/how-to-refresh-reload-a-webpage-with-jquery/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 02:01:21 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=764</guid>
		<description><![CDATA[
			
				
			
		

I was coding a page the other day and needed to have a button that could refresh the webpage when pressed. Turns out jQuery can take care of this rather easily. Check out the demo below, and keep reading for the code.
View Demo

First hook your page to jQuery in the head of your page.
&#60;script type=&#34;text/javascript&#34; [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fhow-to-refresh-reload-a-webpage-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F06%2Fhow-to-refresh-reload-a-webpage-with-jquery%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #0f67a1; margin: 0 0 15px 0;" title="jQuery web page refresh" src="http://webdesignandsuch.com/posts/jquery-page-refresh/refresh-jquery.jpg" alt="jQuery web page refresh" width="422" height="211" /></p>
<p>I was coding a page the other day and needed to have a button that could refresh the webpage when pressed. Turns out jQuery can take care of this rather easily. Check out the demo below, and keep reading for the code.</p>
<p><a class="demo-link" href="http://www.webdesignandsuch.com/posts/jquery-page-refresh/index.html">View Demo</a><br />
<span id="more-764"></span><br />
First hook your page to jQuery in the head of your page.</p>
<div class="codeBox">&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;</div>
<p>Then add the following code below that (still in the head of your document).</p>
<div class="codeBox">&lt;script type=&quot;text/javascript&quot;&gt;<br />
$(document).ready(function() {<br />
$(&#39;#resetButton&#39;).click(function() {<br />
location.reload();<br />
});<br />
});<br />
&lt;/script&gt;</div>
<p>Hook your button up with the same id that you have in the above code.</p>
<div class="codeBox">&lt;img src=&quot;button.jpg&quot; id=&quot;resetButton&quot; /&gt;</div>
<p>That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/06/how-to-refresh-reload-a-webpage-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add an auto-updating Copyright to your website with Javascript</title>
		<link>http://webdesignandsuch.com/2010/02/add-an-auto-updating-copyright-on-your-website-with-javascript/</link>
		<comments>http://webdesignandsuch.com/2010/02/add-an-auto-updating-copyright-on-your-website-with-javascript/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 14:23:46 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Auto copyright]]></category>
		<category><![CDATA[Current Date Javascipt]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=725</guid>
		<description><![CDATA[
			
				
			
		

Websites need to have the copyrights on them. Usually this is found in the footer of the site. As I was updating a client&#8217;s site the other day I noticed his copyright info was still 2009; so I updated it in the template, applied it to the pages, and re-uploaded everything to the live site.
One [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F02%2Fadd-an-auto-updating-copyright-on-your-website-with-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2010%2F02%2Fadd-an-auto-updating-copyright-on-your-website-with-javascript%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" title="javascript-copyright" src="http://webdesignandsuch.com/posts/js-copyright/copy.gif" alt="" width="422" height="211" style="border:3px solid #ddd; margin:0 0 15px 0"/></p>
<p>Websites need to have the copyrights on them. Usually this is found in the footer of the site. As I was updating a client&#8217;s site the other day I noticed his copyright info was still 2009; so I updated it in the template, applied it to the pages, and re-uploaded everything to the live site.</p>
<p>One of the worst things you can do with your website is to not make updates once it&#8217;s live. Fresh content is the only thing that will keep your users AND search engines returning. One of the best ways to let users know that you never update your website (saaarcasm), is to have a copyright in the footer of your website from 2003. It really is a pain to have to go in at the first of every year to update all of your client&#8217;s websites though. Luckily, Javascript can save us. Using Javascript we can add a copyright to the webpage that will automatically update with the current year. Check out the demo, and then keep reading to grab the code.</p>
<p><a class="demo-link" href="http://www.webdesignandsuch.com/posts/js-copyright/index.html">View Demo</a></p>
<p><span id="more-725"></span></p>
<p>All you need to do is paste the following code right into the XHTML where you want the copyright to show up, Javascript does the rest!</p>
<div class="codeBox">&lt;p &gt;&amp;copy;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
var currentTime = new Date()<br />
var year = currentTime.getFullYear()<br />
document.write(year)<br />
&lt;/script&gt;<br />
&lt;/p&gt;</div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2010/02/add-an-auto-updating-copyright-on-your-website-with-javascript/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Embed a Twitter Feed on your website with jQuery</title>
		<link>http://webdesignandsuch.com/2009/12/embed-a-twitter-feed-on-your-website-with-jquery/</link>
		<comments>http://webdesignandsuch.com/2009/12/embed-a-twitter-feed-on-your-website-with-jquery/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 01:17:34 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Twit]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=612</guid>
		<description><![CDATA[
			
				
			
		

In a previous post I showed possibly the easiest way to embed a Twitter feed on your website. This brought up a couple of questions from some users.
1. Can you make a background behind individual Tweets?
2. Can you put the date on it&#8217;s own separate line?
As the case goes with a lot of things these [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fembed-a-twitter-feed-on-your-website-with-jquery%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fembed-a-twitter-feed-on-your-website-with-jquery%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/posts/jQuery-twitter/twitter.jpg" title="embed twitter" class="alignnone" width="422" height="211" style="border:3px solid #ddd; margin:0 0 15px 0"/></p>
<p>In a <a href="http://webdesignandsuch.com/2009/11/how-to-embed-a-twitter-feed-on-your-website/">previous post</a> I showed possibly the easiest way to embed a Twitter feed on your website. This brought up a couple of questions from some users.</p>
<p><strong>1. Can you make a background behind individual Tweets?<br />
2. Can you put the date on it&#8217;s own separate line?</strong></p>
<p>As the case goes with a lot of things these days <em><strong>jQuery to the rescue</strong></em>! Check out the demo to see both of these things in action, and then continue reading to see how to accomplish these things with jQuery and download the source files.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/jQuery-twitter/">View Demo</a><span id="more-612"></span></p>
<p>The jQuery and CSS code to make this happen came from Chris over at CSS-Tricks. I slimmed down and edited it to make it work for me. Here is a zip of the files used for the demo so you can download and edit it as you want.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/jQuery-twitter/jQuery-twitter.zip">Download Files</a></p>
<p>You&#8217;ll see in the head of the index page the jQuery which makes it work. The line you need to change is the following:</p>
<div class="codeBox">
<strong>http://twitter.com/status/user_timeline/<span style="color:#09a1dc">ilz_</span>.json?<span style="color:#09a1dc">count=5</span>&#038;callback=?</strong></div>
<p>First replace the part I highlighted in Blue &#8220;ilz_&#8221; with your Twitter user name.<br/><br />
Next, replace &#8220;count=5&#8243; with the number of tweets you want to show up on your page.</p>
<p>Other than that, you should be able to style the rest of the text, links, etc. as long as you know basic CSS. <strong>Enjoy!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/12/embed-a-twitter-feed-on-your-website-with-jquery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jQuery Product Slider</title>
		<link>http://webdesignandsuch.com/2009/12/jquery-product-slider/</link>
		<comments>http://webdesignandsuch.com/2009/12/jquery-product-slider/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 17:49:46 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=602</guid>
		<description><![CDATA[
			
				
			
		

Recently I was put in charge of creating a product slider for a client&#8217;s website. There would be four products shown at a time, with one new product being revealed each time as the slider moved from the right to the left. I figured there was a jQuery slider out there that I could manipulate [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fjquery-product-slider%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fjquery-product-slider%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><a href="http://webdesignandsuch.com/posts/jquery-slider/"><img alt="" src="http://webdesignandsuch.com/posts/jquery-slider/pic.jpg" title="jQuery slider" class="alignnone" width="422" height="211" style=" margin:0 0 15px 0" /></a></p>
<p>Recently I was put in charge of creating a product slider for a client&#8217;s website. There would be four products shown at a time, with one new product being revealed each time as the slider moved from the right to the left. I figured there was a jQuery slider out there that I could manipulate for this, and after a little hunting I found one. </p>
<p>The actual slider and website I created it for isn&#8217;t live yet. I used the base slider I created and used a few Apple images to show the general idea in the demo. So check out the demo, and then keep reading to see the details.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/jquery-slider/">View Demo</a><br />
<span id="more-602"></span><br />
So the original code for this slider is <a href="http://sorgalla.com/jcarousel/" target="_blank">jCarousel</a>. I figured I would put up this demo to show how with a few modifications to the code you can create a useful product slider. You&#8217;ll notice how it&#8217;s created with an unordered list. I also showed how you can use rollover effects, and link each image to a webpage; which is obviously the point of the slider in the first place.</p>
<p>The slider has an autoplay feature. I added some code to the original jCarousel to make the slider go only one product at a time. This is in the head of the index.html file. The line &#8220;<strong>scroll: 1</strong>&#8220;. If you want it to scroll 2 items, change it to 2, and so on.</p>
<p>Now I admit the code here isn&#8217;t the prettiest, but as I mentioned this was created strictly for the demo, to show some of the possibilities. I&#8217;m going to provide all these files in a .zip file for download, in case you want to play around with the slider. Enjoy!</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/jquery-slider/jquery-slider.zip">Download the Files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/12/jquery-product-slider/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Smooth Scroll with Page Anchors and Javascript</title>
		<link>http://webdesignandsuch.com/2009/11/using-smooth-scroll-with-page-anchors-and-javascript/</link>
		<comments>http://webdesignandsuch.com/2009/11/using-smooth-scroll-with-page-anchors-and-javascript/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 11:39:42 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Freebies]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=515</guid>
		<description><![CDATA[
			
				
			
		

Using page anchors is a pretty basic web design technique. If you want to link to a certain part of a page you create an &#8220;Anchor&#8221; at that part of the page. This anchor is what you point your link at. You can link to an anchor on the current page, or to an anchor [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F11%2Fusing-smooth-scroll-with-page-anchors-and-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F11%2Fusing-smooth-scroll-with-page-anchors-and-javascript%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border:3px solid #ddd; margin:0 0 15px 0" title="smooth scroll" src="http://webdesignandsuch.com/imagesForPosts/smooth-scroll.jpg" alt="" width="422" height="211" /></p>
<p>Using page anchors is a pretty basic web design technique. If you want to link to a certain part of a page you create an &#8220;Anchor&#8221; at that part of the page. This anchor is what you point your link at. You can link to an anchor on the current page, or to an anchor on a certain part of another page. Useful, but not all that exciting.</p>
<p>There is, however a quick way to make even the simple act of scrolling up and down a page more visually appealing. It&#8217;s called <strong>Smooth Scroll</strong>. Check out my demo to see this in action, and then keep reading to learn how to add Smooth Scroll to your website.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/smooth-scroll/">View Demo</a><br />
<span id="more-515"></span></p>
<p>So lets start with the basics. To add an anchor on your page add the following in the place that you want you page to scroll to.</p>
<div class="codeBox">&lt;a name=&#8221;bottom&#8221; id=&#8221;bottom&#8221;&gt;&lt;/a&gt;</div>
<p>Then to point your link at this anchor, use the following. (This is to point to an anchor on the same page as the link.)</p>
<div class="codeBox">&lt;p&gt;&lt;a href=&#8221;#bottom&#8221;&gt;Bottom of the page&lt;/a&gt;&lt;/p&gt;</div>
<p>In case you were wondering, the following is how to point at an anchor on a different page.</p>
<div class="codeBox">&lt;p&gt;&lt;a href=&#8221;pageName.html#bottom&#8221;&gt;Bottom of the page&lt;/a&gt;&lt;/p&gt;</div>
<p>All you need for the Javascript Smooth Scroll effect is to link to the JS file, it does everything else for you.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/smooth-scroll/df_smooth_scroll.zip">Dowload Smooth Scroll Javascript</a></p>
<p>You&#8217;ll see the zip has all original files for the Smooth Scroll. Now I give credit where it&#8217;s due, this entire zip is from <a href="http://www.dezinerfolio.com/" target="_blank">DezinerFolio</a>. Make sure you check those guys out for some great freebies and code.</p>
<p>To link to the Javascript file, put the following in your head.</p>
<div class="codeBox">&lt;script type=&#8221;text/javascript&#8221; src=&#8221;smooth.pack.js&#8221;&gt;&lt;/script&gt;</div>
<p>The javascript file is the only file in the zip that you need to use for the Smooth Scroll to work. Have fun, and if you want to an actual webpage that uses this effect, check out the <a href="http://beantowndesign.com/web-portfolio.html">website portfolio</a> of my website.</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/11/using-smooth-scroll-with-page-anchors-and-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to embed a Twitter Feed on your website</title>
		<link>http://webdesignandsuch.com/2009/11/how-to-embed-a-twitter-feed-on-your-website/</link>
		<comments>http://webdesignandsuch.com/2009/11/how-to-embed-a-twitter-feed-on-your-website/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 16:49:15 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=499</guid>
		<description><![CDATA[
			
				
			
		

Lots of people use Twitter. Love it or hate it, it&#8217;s true. I follow other people in the design industry to see what they&#8217;re up to. I use my Twitter page to post updates on things in my life, mostly design related.
One of the great things about Twitter is that you rarely ever go to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F11%2Fhow-to-embed-a-twitter-feed-on-your-website%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F11%2Fhow-to-embed-a-twitter-feed-on-your-website%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/twitter-feed.jpg" title="twitter" class="alignnone" width="422" height="211" style="border:3px solid #ddd; margin:0 0 15px 0"/></p>
<p>Lots of people use Twitter. Love it or hate it, <strong>it&#8217;s true</strong>. I follow other people in the design industry to see what they&#8217;re up to. I use <a href="http://twitter.com/ilz_" target="_blank">my Twitter page</a> to post updates on things in my life, mostly design related.</p>
<p>One of the great things about Twitter is that you rarely ever go to the actual site. You can use a program like Tweetie or TweetDeck to send all your Tweets. Another great thing is the ability to embed your recent Tweets onto other websites. It&#8217;s a rather simple process, so check out my demo and then keep reading to learn how you can embed your Tweets on your page.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/twitter-feed/embed-twitter-feed.html">View Demo</a><br />
<span id="more-499"></span></p>
<div class="codeBox">&lt;script type=&#34;text/javascript&#34; src=&#34;http://twitter.com/javascripts/blogger.js&#34;&gt;&lt;/script&gt;<br />
&lt;script type=&#34;text/javascript&#34; src=&#34;http://twitter.com/statuses/user_timeline/beantowndesign.json?callback=twitterCallback2&amp;count=1&#34;&gt;&lt;/script&gt;</div>
<p>Copy the above code and paste it right into your XHTML code on your webpage, (right in the body).</p>
<p>All you need to do is replace where I have &#8220;beantowndesign&#8221;. That is my Twitter user name, replace it with yours. The other thing you get to decide is how many of the most recent posts you want to show. Change the part where it says &#8220;count=1&#8243; to however many Tweets you want to show up. For example, in the demo I decided to show my last 3 Tweets.</p>
<p>So that&#8217;s all there is to it.. how you style the text, links, and surrounding environment for the feed is up to you and your creativity.</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/11/how-to-embed-a-twitter-feed-on-your-website/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>How to load a random image on pageload ~ Javascript</title>
		<link>http://webdesignandsuch.com/2009/09/how-to-load-a-random-image-on-pageload-javascript/</link>
		<comments>http://webdesignandsuch.com/2009/09/how-to-load-a-random-image-on-pageload-javascript/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 10:27:10 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[load random image]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=386</guid>
		<description><![CDATA[
			
				
			
		

On my portfolio website I have an About page, where I explain&#8230; who I am of course! So I have a picture of myself in the sidebar, but got the idea that it&#8217;d be nice to have the picture change randomly on page load. I looked around at a few different options. Some were Javascript, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F09%2Fhow-to-load-a-random-image-on-pageload-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F09%2Fhow-to-load-a-random-image-on-pageload-javascript%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/me.jpg" title="Beantown Design" class="alignnone" width="560" height="332" /></p>
<p>On my portfolio website I have an <strong><a href="http://beantowndesign.com/about.html">About page</a></strong>, where I explain&#8230; who I am of course! So I have a picture of myself in the sidebar, but got the idea that it&#8217;d be nice to have the picture change randomly on page load. I looked around at a few different options. Some were Javascript, some were PHP. It wasn&#8217;t worth turning the page into a PHP page just for this effect, so I went with Javascript. There are a lot of different options, but here&#8217;s the one I went with. </p>
<p><span id="more-386"></span></p>
<p>I made a div to surround the image, with the class of &#8220;me-box&#8221;. I gave this div a border, so the images will all appear to have a border when they are loaded. Next comes the Javascript code. This is where you give the src to your images. This code is put right in the body of your page where you want the images to appear, not in he head tag. A quick little piece of code that got the job done exactly like I wanted!</p>
<p><a href="http://beantowndesign.com/about.html">See the random image loading in action.</a></p>
<div class="codeBox">
<p>&lt;div class=&#8221;me-box&#8221;&gt;</p>
<p>&lt;script language=&#8221;JavaScript&#8221;&gt;<br />
function banner() { } ; b = new banner() ; n = 0<br />
b[n++]= &#8220;&lt;img name=randimg src=&#8217;images/me.jpg&#8217; &gt;&#8221;<br />
b[n++]= &#8220;&lt;img name=randimg src=&#8217;images/me2.jpg&#8217; &gt;&#8221;<br />
b[n++]= &#8220;&lt;img name=randimg src=&#8217;images/me4.jpg&#8217; &gt;&#8221;<br />
b[n++]= &#8220;&lt;img name=randimg src=&#8217;images/me5.jpg&#8217; &gt;&#8221;<br />
b[n++]= &#8220;&lt;img name=randimg src=&#8217;images/me6.jpg&#8217; &gt;&#8221;<br />
b[n++]= &#8220;&lt;img name=randimg src=&#8217;images/me3.jpg&#8217; &gt;&#8221;<br />
i=Math.floor(Math.random() * n) ;<br />
document.write( b[i] )<br />
&lt;/script&gt;</p>
<p>&lt;/div&gt;</p></div>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/09/how-to-load-a-random-image-on-pageload-javascript/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>CSS stylesheet switcher ~ Javascript, Dreamweaver, Kaos</title>
		<link>http://webdesignandsuch.com/2009/09/css-stylesheet-switcher-javascript-dreamweaver-kaos/</link>
		<comments>http://webdesignandsuch.com/2009/09/css-stylesheet-switcher-javascript-dreamweaver-kaos/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 15:00:56 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Kaosweaver]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=376</guid>
		<description><![CDATA[
			
				
			
		

Here&#8217;s an interesting way to add a CSS stylesheet switcher to your website. I&#8217;ve used stylesheet switchers in the past, but this one is different. In the past I had a button to press, which in turn switched the stylesheet of the page. This one switches the sheet at a certain time of day, which [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F09%2Fcss-stylesheet-switcher-javascript-dreamweaver-kaos%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F09%2Fcss-stylesheet-switcher-javascript-dreamweaver-kaos%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/bean/both.jpg" title="Beantown Design" class="alignnone" width="560" height="161" /></p>
<p>Here&#8217;s an interesting way to add a CSS stylesheet switcher to your website. I&#8217;ve used stylesheet switchers in the past, but this one is different. In the past I had a button to press, which in turn switched the stylesheet of the page. This one switches the sheet at a certain time of day, which I think is pretty cool. <a href="http://www.BeantownDesign.com">My website</a> uses clouds in the header, so it was just begging for me to make a &#8220;night&#8221; version of the header which would automatically switch on at night.</p>
<p><span id="more-376"></span></p>
<p>The first thing to get is the Dreamweaver plugin from the guys over at Kaosweaver. <a href="http://www.kaosweaver.com/extensions/details.php?id=46">Here&#8217;s the link to the plugin.</a> Once you download and install that, open up Dreamweaver and the page you want to apply the style switcher to. Under <strong>Commands</strong>, you&#8217;ll see <strong>Style Switcher Lite</strong>.</p>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/bean/style-switcher.jpg" title="CSS switcher" class="alignnone" width="786" height="498" class="frame"/></p>
<p>Click on that and this little box pops up.</p>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/bean/css-switcher.jpg" title="CSS switcher" class="alignnone" width="548" height="243" /></p>
<p>This is where you set your day and night stylesheets, and set what time of day you want the sweets to switch. What you do in the stylesheets is up to you. You can change colors, background-images, the options are endless. For the effect I wanted, I changed the background images of two things.. the clouds and the buildings (Boston skyline), which floats in front of the clouds.</p>
<p>So there you have it, here are the two versions that you&#8217;ll see at <a href="http://www.BeantownDesign.com">BeantownDesign.com</a>, depending on what time you&#8217;re looking at the website.</p>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/bean/day.jpg" title="Beantown Design" class="alignnone" width="560" height="161" /></p>
<p><img alt="" src="http://webdesignandsuch.com/imagesForPosts/bean/night.jpg" title="Beantown Design" class="alignnone" width="560" height="161" /></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/09/css-stylesheet-switcher-javascript-dreamweaver-kaos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Add the Current Date to your webpage with Javascipt</title>
		<link>http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt/</link>
		<comments>http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 18:11:13 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Current Date Javascipt]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://webdesignandsuch.com/?p=249</guid>
		<description><![CDATA[
			
				
			
		

The other day I was cutting and coding a website for a bank. One feature that was in the header was the current date, which would update daily (duh). I know in a previous project I had done this with Javascipt, so I back-tracked and got the code I used before. Here is the code, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px; margin-bottom:10px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F07%2Fhow-to-add-the-current-date-to-your-webpage-with-javascipt%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F07%2Fhow-to-add-the-current-date-to-your-webpage-with-javascipt%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img src="http://webdesignandsuch.com/wp-content/uploads/2009/07/Picture-1.png" alt="current-date-javascript" title="current-date-javascript" width="519" height="180" class="alignnone size-full wp-image-266" class="frame"/></p>
<p>The other day I was cutting and coding a website for a bank. One feature that was in the header was the current date, which would update daily <em>(duh)</em>. I know in a previous project I had done this with Javascipt, so I back-tracked and got the code I used before. Here is the code, which will print the date on your web page in the following format: <br /><strong>July 18, 2009</strong></p>
<p>The first step is to link your XHTML page to the external Javascript page, which has the code which will make it all happen. Paste the code below in the Head of your page.</p>
<h3>Link to external Javascript File</h3>
<div class="codeBox">
<pre id="line17">&lt;<span>script</span><span> type</span>=<span>"text/javascript" </span><span>src</span>=<span>"js/date.js"</span>&gt;&lt;/<span>script</span>&gt;</pre>
</div>
<p><span id="more-249"></span></p>
<p>Next up is the make this Javascript page that you just linked to. Paste the following code inside a new javascipt page, and save it as &#8220;date.js&#8221; inside your &#8220;js&#8221; folder. You can of course use different names, just make sure you link them up correctly.</p>
<h3>Here is the code for your Javascript File</h3>
<div class="codeBox">
<pre>// JavaScript Document

//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("January","February","March","April","May",
"June","July","August","September","October","November",
"December");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = monthname[d.getMonth()] + " " + d.getDate() + ", "
+ d.getFullYear();
//---------------   END LOCALIZEABLE   ---------------
</div>


<p style="margin-top:15px">The last step is the put the following code in your XHTML file where you want the date to be written. The id="date" that you see is for the CSS styling of this text. You can rename or remove it if you are styling it differently.
<h3>Paste this inside your XHTML file</h3>
<div class="codeBox">
<pre id="line90"> &lt;<span>p</span><span> id</span>=<span>"date"</span>&gt;
&lt;<span>script</span><span> language</span>=<span>"JavaScript" </span><span>type</span>=<span>"text/javascript" </span>&gt;
document.write(TODAY);&lt;/<span>script</span>&gt;&lt;/<span>p</span>&gt;</pre>
</pre>
</div>
<p></p>
<p>So there it is. <br /><a href="http://webdesignandsuch.com/current-date-js/" target="_blank">You can view a live example here.</a> </p>
<p>I also packed this up into a zip so you can download and have all the files; including the XHTML, CSS, and JS. <br /><a href="http://webdesignandsuch.com/current-date-js/current-date-js.zip">Download the zip here.</a></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/07/how-to-add-the-current-date-to-your-webpage-with-javascipt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
