<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Trond Ulseth&apos;s Blog - DHTML / Javascript</title>
			<link>http://trond.ulseth.no/index.cfm</link>
			<description>Trond Ulseth</description>
			<language>en-us</language>
			<pubDate>Wed, 02 Jan 2008 16:36:49 -0600</pubDate>
			<lastBuildDate>Mon, 26 Nov 2007 09:22:00 -0600</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>trond@ulseth.no</managingEditor>
			<webMaster>trond@ulseth.no</webMaster>
			
			
			
			
			
			<item>
				<title>Alternate row colors with jQuery</title>
				<link>http://trond.ulseth.no/index.cfm/2007/11/26/Alternate-row-colors-with-JQuery</link>
				<description>
				
				I was in the need of a script for alternating row colors in a table on a web site I&apos;m doing. I&apos;ve done this before, but since I&apos;m getting into jQuery these days I thought I&apos;d try to find a way of doing it using this.

Well, a little Googling and I came upon &lt;a href=&quot;http://www.packtpub.com/article/jquery-table-manipulation-part2&quot; target=&quot;_blank&quot;&gt;this website&lt;/a&gt;.

This is an excerpt from the book Learning jQuery. Need to try and get my boss to buy that one.
				
				</description>
				
				<category>jQuery</category>
				
				<category>DHTML / Javascript</category>
				
				<category>CSS</category>
				
				<pubDate>Mon, 26 Nov 2007 09:22:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/11/26/Alternate-row-colors-with-JQuery</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>Dealing with IE6 and png&apos;s - part 2</title>
				<link>http://trond.ulseth.no/index.cfm/2007/3/23/Dealing-with-IE6-and-pngs--part-2</link>
				<description>
				
				Ok - here&apos;s the long awaited follow up to this little series of posts dealing with IE6 and png&apos;s.

The last time we saw how we can make use of transparent png&apos;s as backgrounds in our site layouts, included in our .css files. But what if we want to use png in our html source like so:

&lt;code&gt;
&lt;img src=&quot;/images/transparentIllustration.png&quot; heigth=&quot;20&quot; width=&quot;200&quot; /&gt;
&lt;/code&gt;

Here&apos;s the way I prefer to deal with such situations. This method is a &quot;implement once, work on all images&quot; kinda thing.

The downside, but one I&apos;m willing to live with, is that the IE user has to have JavaScript enabled.

First create a pngfix.js file and paste the following into it:

&lt;code&gt;
var arVersion = navigator.appVersion.split(&quot;MSIE&quot;)
var version = parseFloat(arVersion[1])

if ((version &gt;= 5.5) &amp;&amp; (document.body.filters)) 
{
   for(var i=0; i&lt;document.images.length; i++)
   {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == &quot;PNG&quot;)
      {
         var imgID = (img.id) ? &quot;id=&apos;&quot; + img.id + &quot;&apos; &quot; : &quot;&quot;
         var imgClass = (img.className) ? &quot;class=&apos;&quot; + img.className + &quot;&apos; &quot; : &quot;&quot;
         var imgTitle = (img.title) ? &quot;title=&apos;&quot; + img.title + &quot;&apos; &quot; : &quot;title=&apos;&quot; + img.alt + &quot;&apos; &quot;
         var imgStyle = &quot;display:inline-block;&quot; + img.style.cssText 
         if (img.align == &quot;left&quot;) imgStyle = &quot;float:left;&quot; + imgStyle
         if (img.align == &quot;right&quot;) imgStyle = &quot;float:right;&quot; + imgStyle
         if (img.parentElement.href) imgStyle = &quot;cursor:hand;&quot; + imgStyle
         var strNewHTML = &quot;&lt;span &quot; + imgID + imgClass + imgTitle
         + &quot; style=\&quot;&quot; + &quot;width:&quot; + img.width + &quot;px; height:&quot; + img.height + &quot;px;&quot; + imgStyle + &quot;;&quot;
         + &quot;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader&quot;
         + &quot;(src=\&apos;&quot; + img.src + &quot;\&apos;, sizingMethod=&apos;scale&apos;);\&quot;&gt;&lt;/span&gt;&quot; 
         img.outerHTML = strNewHTML
         i = i-1
      }
   }
}
&lt;/code&gt;

Then in the head of your page you do this:

&lt;code&gt;
&lt;!--[if lt IE 7]&gt;
	&lt;script defer type=&quot;text/javascript&quot; src=&quot;/js/pngfix.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;
&lt;/code&gt;

As much as I wish I was smart enough to come up with this my self, the credit goes to &lt;a href=&quot;http://homepage.ntlworld.com/bobosola/index.htm&quot; target=&quot;_blank&quot;&gt;Bob Osola&lt;/a&gt; who in turn is crediting more people on his site.
				
				</description>
				
				<category>DHTML / Javascript</category>
				
				<category>CSS</category>
				
				<pubDate>Fri, 23 Mar 2007 09:48:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/3/23/Dealing-with-IE6-and-pngs--part-2</guid>
				
			</item>
			
		 	
			
			
			<item>
				<title>A nice countdown script</title>
				<link>http://trond.ulseth.no/index.cfm/2005/3/23/DHTML-countdown</link>
				<description>
				
				A client today requested a running countdown displayed on his web page. I did as I always do in such cases - I googled to see if I could find a good one (no point in re-inventing the wheel every time).

Pretty soon I found &lt;a href=&quot;http://www.andrewu.co.uk/clj/countdown/&quot; target=&quot;_blank&quot;&gt;DHTML Easy Countdown&lt;/a&gt; by a guy named Andrew Urquhart. Seems like there is more stuff on his site worth looking into as well.
				
				</description>
				
				<category>DHTML / Javascript</category>
				
				<pubDate>Wed, 23 Mar 2005 09:24:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2005/3/23/DHTML-countdown</guid>
				
				<enclosure url="http://trond.ulseth.no/enclosures/0" length="0" type=""/>
				
			</item>
			
		 	
			</channel></rss>
<SCRIPT language="Javascript">
<!--

// FILE ARCHIVED ON 20080102223659 AND RETRIEVED FROM THE
// INTERNET ARCHIVE ON 20100801044739.
// JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
// ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
// SECTION 108(a)(3)).

   var sWayBackCGI = "http://web.archive.org/web/20080102223659/";

   function xResolveUrl(url) {
      var image = new Image();
      image.src = url;
      return image.src;
   }
   function xLateUrl(aCollection, sProp) {
      var i = 0;
      for(i = 0; i < aCollection.length; i++) {
         var url = aCollection[i][sProp];         if (typeof(url) == "string") { 
          if (url.indexOf("mailto:") == -1 &&
             url.indexOf("javascript:") == -1
             && url.length > 0) {
            if(url.indexOf("http") != 0) {
                url = xResolveUrl(url);
            }
            url = url.replace('.wstub.archive.org','');
            aCollection[i][sProp] = sWayBackCGI + url;
         }
         }
      }
   }

   xLateUrl(document.getElementsByTagName("IMG"),"src");
   xLateUrl(document.getElementsByTagName("A"),"href");
   xLateUrl(document.getElementsByTagName("AREA"),"href");
   xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
   xLateUrl(document.getElementsByTagName("OBJECT"),"data");
   xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
   xLateUrl(document.getElementsByTagName("APPLET"),"archive");
   xLateUrl(document.getElementsByTagName("EMBED"),"src");
   xLateUrl(document.getElementsByTagName("BODY"),"background");
   xLateUrl(document.getElementsByTagName("TD"),"background");
   xLateUrl(document.getElementsByTagName("INPUT"),"src");
   var forms = document.getElementsByTagName("FORM");
   if (forms) {
       var j = 0;
       for (j = 0; j < forms.length; j++) {
              f = forms[j];
              if (typeof(f.action)  == "string") {
                 if(typeof(f.method)  == "string") {
                     if(typeof(f.method) != "post") {
                        f.action = sWayBackCGI + f.action;
                     }
                  }
              }
        }
    }


//-->
</SCRIPT>

