<?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/tag/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>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>How to create a Popup with CSS and Javascript</title>
		<link>http://webdesignandsuch.com/2009/12/how-to-create-a-popup-with-css-and-javascript/</link>
		<comments>http://webdesignandsuch.com/2009/12/how-to-create-a-popup-with-css-and-javascript/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 17:27:23 +0000</pubDate>
		<dc:creator>ilz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Pop Up]]></category>
		<category><![CDATA[Popup]]></category>

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

Popups suck.
The good thing is you don&#8217;t see that many of them any more. That&#8217;s because browsers recognize that they suck and are most likely spam or ads and so they block the popups. The old way of creating a popup was to force open a new browser window over the current browser window. So [...]]]></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%2Fhow-to-create-a-popup-with-css-and-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=?url=http%3A%2F%2Fwebdesignandsuch.com%2F2009%2F12%2Fhow-to-create-a-popup-with-css-and-javascript%2F&amp;style=normal" height="61" width="51" /><br />
			</a>
		</div>
<p><img class="alignnone" style="border: 3px solid #000; margin: 0 0 15px 0;" title="css popup" src="http://webdesignandsuch.com/posts/css-popup/pop.gif" alt="" width="422" height="211" /></p>
<h2 style="margin-bottom:20px">Popups suck.</h2>
<p>The good thing is you don&#8217;t see that many of them any more. That&#8217;s because browsers recognize that they suck and are most likely spam or ads and so they block the popups. The old way of creating a popup was to force open a new browser window over the current browser window. So this is what browsers block. But what if you actually have a need to use a popup window for something useful and not spammy? This happened to me the other day. A client wanted a popup window on their homepage to wish everyone a Merry Christmas.</p>
<p>Knowing I couldn&#8217;t use the old popup method, I went searching. I knew it&#8217;d be easy enough to use CSS to put a floating div over the content of the site, which creates a popup effect. The problem was how do you close the popup once it&#8217;s open? Javascript would be needed for this. Check out the demo I setup which shows how the <strong>CSS popup</strong> can be set to open on <strong>pageload</strong> or by <strong>clicking on a link</strong>; and then how Javascript allows you to have a &#8220;close&#8221; button that shuts or hides the popup. Then continue reading for the code and downloadable files.</p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/css-popup/css-popup.html">View Demo</a></p>
<p><span id="more-709"></span></p>
<p>If you check out the source code of the html file, you&#8217;ll see the following in the body. The &#8220;<strong>blanket</strong>&#8221; is the effect of putting the transparent black background behind the popup, which helps separate it from the rest of the content on the page. The &#8220;<strong>popUpDiv</strong>&#8221; is where you put the content of your popup.</p>
<div class="codeBox">&lt;div id=&#8221;blanket&#8221; style=&#8221;display:none;&#8221;&gt;&lt;/div&gt;<br />
&lt;div id=&#8221;popUpDiv&#8221; style=&#8221;display:none;&#8221;&gt;</p>
<p>&lt;a href=&#8221;#&#8221; onclick=&#8221;popup(&#8216;popUpDiv&#8217;)&#8221; &gt;Click to Close CSS Pop Up&lt;/a&gt;<br />
&lt;/div&gt;<br />
&lt;a href=&#8221;#&#8221; onclick=&#8221;popup(&#8216;popUpDiv&#8217;)&#8221;&gt;Click to Open CSS Pop Up&lt;/a&gt;</p>
</div>
<p>If you want the popup to load on <strong>page load</strong>, put the following in your body tag.</p>
<div class="codeBox">&lt;body   onload=&#8221;popup(&#8216;popUpDiv&#8217;)&#8221;&gt;</div>
<p>Here is the CSS used to style the blanket effect and the popup div. You&#8217;ll see I turned the blanket effect off for Internet Explorer, since it doesn&#8217;t appear to support &#8220;opacity&#8221; (big surprise).</p>
<div class="codeBox">#blanket {<br />
background-color:#111;<br />
opacity: 0.65;<br />
*background:none;<br />
position:absolute;<br />
z-index: 9001;<br />
top:0px;<br />
left:0px;<br />
width:100%;<br />
}</p>
<p>#popUpDiv {<br />
position:absolute;<br />
background:url(pop-back.jpg) no-repeat;<br />
width:400px;<br />
height:400px;<br />
border:5px solid #000;<br />
z-index: 9002;<br />
}</p>
</div>
<p>There is a Javacript file linked to the html file to make some of the magic happen. I&#8217;m going to make the demo files available so you can play with it and make your own. <strong>Enjoy!</strong></p>
<p><a class="demo-link" href="http://webdesignandsuch.com/posts/css-popup/css-popup.zip">Download Files</a></p>
<p>One last thing.. the original code for this was <a href="http://www.pat-burt.com/web-development/how-to-do-a-css-popup-without-opening-a-new-window/">found here</a>. I made some edits to make it work for my application.</p>
]]></content:encoded>
			<wfw:commentRss>http://webdesignandsuch.com/2009/12/how-to-create-a-popup-with-css-and-javascript/feed/</wfw:commentRss>
		<slash:comments>3</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>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>
