<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Random CSS with JavaScript</title>
	<atom:link href="http://zodomatica.com/web-tips/random-css-with-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://zodomatica.com/web-tips/random-css-with-javascript/</link>
	<description>Bits of Tzaddi&#039;s Life</description>
	<lastBuildDate>Wed, 17 Nov 2010 04:02:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: blog</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-737</link>
		<dc:creator>blog</dc:creator>
		<pubDate>Tue, 02 Mar 2010 13:35:06 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-737</guid>
		<description>Yes so did I, thanks</description>
		<content:encoded><![CDATA[<p>Yes so did I, thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Canvas Prints</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-736</link>
		<dc:creator>Canvas Prints</dc:creator>
		<pubDate>Tue, 02 Mar 2010 13:34:24 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-736</guid>
		<description>Thanks for this script we managed to get it working last night with a couple of alterations.</description>
		<content:encoded><![CDATA[<p>Thanks for this script we managed to get it working last night with a couple of alterations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: software development uk</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-691</link>
		<dc:creator>software development uk</dc:creator>
		<pubDate>Tue, 18 Aug 2009 08:53:47 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-691</guid>
		<description>Hey, that was interesting,

I don&#039;t think this concept is widely used but the way you implemented it was intersting giving the same name to all CSS file with  a numeric number at the end wasa so wise

Anyway, thanks for the post</description>
		<content:encoded><![CDATA[<p>Hey, that was interesting,</p>
<p>I don&#8217;t think this concept is widely used but the way you implemented it was intersting giving the same name to all CSS file with  a numeric number at the end wasa so wise</p>
<p>Anyway, thanks for the post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Rouxel</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-689</link>
		<dc:creator>Chris Rouxel</dc:creator>
		<pubDate>Wed, 15 Jul 2009 10:55:31 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-689</guid>
		<description>Hi Tzaddi!

Thinks very much for the script!!

I was wondering... it it at all possible for the Script to load a random CSS file and also a flash file that ties in with that CSS?

If say if the Java pick CSS style 1, Flash file 1 is picked also, CSS3 picked - Flash file 3 picked also.

Thanks for any help you can give!!

Chris.</description>
		<content:encoded><![CDATA[<p>Hi Tzaddi!</p>
<p>Thinks very much for the script!!</p>
<p>I was wondering&#8230; it it at all possible for the Script to load a random CSS file and also a flash file that ties in with that CSS?</p>
<p>If say if the Java pick CSS style 1, Flash file 1 is picked also, CSS3 picked &#8211; Flash file 3 picked also.</p>
<p>Thanks for any help you can give!!</p>
<p>Chris.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tzaddi</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-681</link>
		<dc:creator>Tzaddi</dc:creator>
		<pubDate>Mon, 22 Jun 2009 00:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-681</guid>
		<description>Hi Sebastian
I&#039;m glad you found it useful. 
Sorry script stuff doesn&#039;t come through well in the comments. I&#039;ll comment a bit here and then update the post.

I&#039;m sure you could adapt the script for that. You&#039;d need to:

1. move the location of where you include the script tag. In my example I had it in the Head, the usual place of a css file. You&#039;d want it wherever you want the image to show up.
&lt;del datetime=&quot;2009-06-22T00:47:20+00:00&quot;&gt;2. change the value you&#039;re setting for the variable &quot;style&quot;. I&#039;d probably change the name of the variable to reflect that we&#039;re not setting a style. So you might have the variable &quot;image&quot;, and instead of setting it to be css stuff, you&#039;d set it to the image file name perhaps.&lt;/del&gt; I changed my mind when I wrote it - I don&#039;t think you need to set a variable there unless you want to rewrite it later.
3. adjust the document write statements accordingly, so that all the document.writes put together make the complete image tag.

Hope that helps.</description>
		<content:encoded><![CDATA[<p>Hi Sebastian<br />
I&#8217;m glad you found it useful.<br />
Sorry script stuff doesn&#8217;t come through well in the comments. I&#8217;ll comment a bit here and then update the post.</p>
<p>I&#8217;m sure you could adapt the script for that. You&#8217;d need to:</p>
<p>1. move the location of where you include the script tag. In my example I had it in the Head, the usual place of a css file. You&#8217;d want it wherever you want the image to show up.<br />
<del datetime="2009-06-22T00:47:20+00:00">2. change the value you&#8217;re setting for the variable &#8220;style&#8221;. I&#8217;d probably change the name of the variable to reflect that we&#8217;re not setting a style. So you might have the variable &#8220;image&#8221;, and instead of setting it to be css stuff, you&#8217;d set it to the image file name perhaps.</del> I changed my mind when I wrote it &#8211; I don&#8217;t think you need to set a variable there unless you want to rewrite it later.<br />
3. adjust the document write statements accordingly, so that all the document.writes put together make the complete image tag.</p>
<p>Hope that helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Thomas</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-680</link>
		<dc:creator>Sebastian Thomas</dc:creator>
		<pubDate>Fri, 19 Jun 2009 16:36:32 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-680</guid>
		<description>Still not working. Sorry.</description>
		<content:encoded><![CDATA[<p>Still not working. Sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Thomas</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-679</link>
		<dc:creator>Sebastian Thomas</dc:creator>
		<pubDate>Fri, 19 Jun 2009 16:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-679</guid>
		<description>Ok that didn&#039;t post correctly:


Untitled Document


var random=Math.floor(3*Math.random());
random=random+1;
style=&#039;&lt;!-- ( &#039; + random + &#039;.jpg ); --&gt;&#039;;
document.body.write(&#039;&#039;);





test

</description>
		<content:encoded><![CDATA[<p>Ok that didn&#8217;t post correctly:</p>
<p>Untitled Document</p>
<p>var random=Math.floor(3*Math.random());<br />
random=random+1;<br />
style=&#8217;<!-- ( ' + random + '.jpg ); -->&#8216;;<br />
document.body.write(&#8221;);</p>
<p>test</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sebastian Thomas</title>
		<link>http://zodomatica.com/web-tips/random-css-with-javascript/comment-page-1/#comment-678</link>
		<dc:creator>Sebastian Thomas</dc:creator>
		<pubDate>Fri, 19 Jun 2009 16:35:19 +0000</pubDate>
		<guid isPermaLink="false">http://zodomatica.com/?p=383#comment-678</guid>
		<description>Hi! Thanks a lot for your code. I&#039;m just experimenting with random background images. I wanted to use load a random CSS to output a random BG image, but I also want that image stretched and CSS doesn&#039;t support that :S
There are loads of randomising JS scripts out there but yours is especially neat as it uses maths and naming convention as opposed to loading a whole array of file names. 

I was wondering whether you could suggest a way to adopt this script to load a random img into the html? I thought I could use adopt your document.write and change the .css to .jpg to inject the code directly into the html, but unsuprisingly it doesn&#039;t work...

Any ideas? Thanks. 

here&#039;s what I was was playing with, probably complete trash:




Untitled Document


var random=Math.floor(3*Math.random());
random=random+1;
style=&#039;&lt;!-- ( &#039; + random + &#039;.jpg ); --&gt;&#039;;
document.body.write(&#039;&#039;);





test


</description>
		<content:encoded><![CDATA[<p>Hi! Thanks a lot for your code. I&#8217;m just experimenting with random background images. I wanted to use load a random CSS to output a random BG image, but I also want that image stretched and CSS doesn&#8217;t support that :S<br />
There are loads of randomising JS scripts out there but yours is especially neat as it uses maths and naming convention as opposed to loading a whole array of file names. </p>
<p>I was wondering whether you could suggest a way to adopt this script to load a random img into the html? I thought I could use adopt your document.write and change the .css to .jpg to inject the code directly into the html, but unsuprisingly it doesn&#8217;t work&#8230;</p>
<p>Any ideas? Thanks. </p>
<p>here&#8217;s what I was was playing with, probably complete trash:</p>
<p>Untitled Document</p>
<p>var random=Math.floor(3*Math.random());<br />
random=random+1;<br />
style=&#8217;<!-- ( ' + random + '.jpg ); -->&#8216;;<br />
document.body.write(&#8221;);</p>
<p>test</p>
]]></content:encoded>
	</item>
</channel>
</rss>

