<?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>Catzie.net Blog &#187; JavaScript</title>
	<atom:link href="http://blog.catzie.net/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.catzie.net</link>
	<description>Programming, Networking, and other Downloads by Catzie</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:19:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>JavaScript: Setting the selected dropdown option by its index number</title>
		<link>http://blog.catzie.net/javascript-setting-the-selected-dropdown-option-by-its-index-number/</link>
		<comments>http://blog.catzie.net/javascript-setting-the-selected-dropdown-option-by-its-index-number/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 05:30:10 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=327</guid>
		<description><![CDATA[Long time no new entry. Internship is keeping me very busy. In this blog entry I&#8217;ll show you how to select a drop down option by specifying its index number. The JavaScript code: document.getElementById("selectionDD").selectedIndex = 0; The HTML code: &#60;select id="selectionDD" name="selectionDD"&#62; &#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#60;option value="one"&#62;One&#60;/option&#62; &#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#60;option value="two"&#62;Two&#60;/option&#62; &#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#60;option value="three"&#62;Three&#60;/option&#62; &#60;/select&#62; Refer to the JavaScript code. The [...]]]></description>
			<content:encoded><![CDATA[<p>Long time no new entry. <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Internship is keeping me very busy. In this blog entry I&#8217;ll show you how to select a drop down option by specifying its index number.<br />
<span id="more-327"></span><br />
<strong>The JavaScript code:</strong></p>
<pre class="xml">
document.getElementById("selectionDD").selectedIndex = 0;
</pre>
<p><strong>The HTML code:</strong></p>
<pre class="xml">
&lt;select id="selectionDD" name="selectionDD"&gt;
&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&lt;option value="one"&gt;One&lt;/option&gt;
&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&lt;option value="two"&gt;Two&lt;/option&gt;
&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&#038;nbsp&lt;option value="three"&gt;Three&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>Refer to the JavaScript code. The <code>selectionDD </code>is the id of the <code>&lt;select&gt;</code> tag. The value 0 represents the index number of the option that we want to be selected, and will select the first option in the selection. Note that the index numbers start with 0, not 1.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/javascript-setting-the-selected-dropdown-option-by-its-index-number/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fix PNG images with transparency in older Windows Internet Explorer versions</title>
		<link>http://blog.catzie.net/fix-png-images-with-transparency-in-older-windows-internet-explorer-versions/</link>
		<comments>http://blog.catzie.net/fix-png-images-with-transparency-in-older-windows-internet-explorer-versions/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 06:49:31 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PNG images]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=251</guid>
		<description><![CDATA[I wonder if this post would still get hits from search engine result pages. So many other web pages feature this fix for IE 5.5 and IE 6 web browser, that the Catzie.net Blog&#8217;s entry might just show up on the&#8230; 10th page or so. lol. Anyways, I&#8217;m still posting this, in case there are [...]]]></description>
			<content:encoded><![CDATA[<p>I wonder if this post would still get hits from search engine result pages. So many other web pages feature this fix for <strong>IE 5.5 and IE 6</strong> web browser, that the Catzie.net Blog&#8217;s entry might just show up on the&#8230; 10th page or so. lol.</p>
<p>Anyways, I&#8217;m still posting this, in case there are some visitors browsing around who need help with properly displaying the transparency of <strong>.PNG</strong> images in <strong>IE5.5 and IE6</strong>. This also helps me easily find the needed code to fix the display. I need it from time to time when I design website layouts. <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color: red;">Tip:</span> Most of us are probably using the newer versions of Internet Explorer. I suggest that you <a href="http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/">download and use the IE Tester</a>. It&#8217;s a web browser that lets you see how web pages render in different versions of IE &#8211; 5.5, 6, 7, and 8.</p>
<p>I assume that as you read this, you are using Internet Explorer version 5.5, or the version 5.5 tab on the <a href="http://blog.catzie.net/ie-tester-see-how-your-web-pages-look-in-different-versions-of-ie-windows-internet-explorer/">IE Tester</a>.<br />
<span id="more-251"></span><br />
The following .png image has a grayish background color that replaces the parts that are supposed to be transparent.</p>
<div style="background:pink;padding:20px;">
<img src="http://img.photobucket.com/albums/v209/catzie/transparent1.png" alt="" />
</div>
<p>This is the code for what&#8217;s show above.</p>
<pre name="code" class="xml">
&lt;div style="background:pink;padding:20px;"&gt;
&lt;img src="http://img.photobucket.com/albums/v209/catzie/transparent1.png"
alt="" /&gt;
&lt;/div&gt;
</pre>
<p><a href="../pages/html/PNGtransparencyIE.html" target="_blank">Please click here</a> to open on a new window the fixed version of what we are trying to display. You&#8217;d notice that there&#8217;s no longer the  grayish background on the parts that are supposed to be transparent. Now you can see through the pink background.</p>
<p>The final code is:</p>
<pre name="code" class="xml">
&lt;html&gt;
&lt;head&gt;
	&lt;style type="text/css"&gt;
		body{
			background-color:pink;
		}
	&lt;/style&gt;
&lt;!--[if lt IE 7]&gt;
&lt;script language="JavaScript"&gt;
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 &#038; 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version &gt;= 5.5) &#038;&#038; (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) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className
                               + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " :
                               "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "&lt;span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height
            + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"&lt;&gt;/span&gt;"
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }
}
window.attachEvent("onload", correctPNG);
&lt;/script&gt;
&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div style="background:pink;padding:20px;"&gt;
         &lt;img src="http://img.photobucket.com/albums/v209/catzie/transparent1.png"
                alt="" /&gt;
  &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The code above uses <b>conditional comment</b> to check if your current browser is older than IE 7. If it is, the JavaScript code which corrects the display of the .png is executed.</p>
<p>This method has limitations though. It works only on IE5.5 and IE6. It needs JavaScript enabled on your browser, or else it won&#8217;t work. And it only works on images placed using the &lt;img&gt; tag. It won&#8217;t work on background images.</p>
<p>I learned about this fix from <a href="http://homepage.ntlworld.com/bobosola" rel="nofollow" onclick="pageTracker._trackPageview('/outgoing/homepage.ntlworld.com/bobosola?referer=');">this website</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/fix-png-images-with-transparency-in-older-windows-internet-explorer-versions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inline Frame that automatically adjusts its height for the source page</title>
		<link>http://blog.catzie.net/inline-frame-that-automatically-adjusts-its-height-for-the-source-page/</link>
		<comments>http://blog.catzie.net/inline-frame-that-automatically-adjusts-its-height-for-the-source-page/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 04:58:10 +0000</pubDate>
		<dc:creator>Catzie</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.catzie.net/?p=234</guid>
		<description><![CDATA[Last year, I was working on our MULPROJ layout, and the type of layout I was making needed an iframe whose height is auto resized according to the source page&#8217;s content. This means that there should be no vertical scrollbar in the iframe, it simply adjusts itself vertically. I thought that it wasn&#8217;t possible to [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, I was working on our <acronym title="Multimedia Web Design Project">MULPROJ</acronym> layout, and the type of layout I was making needed an iframe whose height is auto resized according to the source page&#8217;s content. This means that there should be no vertical scrollbar in the iframe, it simply adjusts itself vertically.</p>
<p>I thought that it wasn&#8217;t possible to do this but I found a JavaScript code that can do the trick, and I just want to share it with you. <img src='http://blog.catzie.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
<span id="more-234"></span></p>
<pre name="code" class="xml">

&lt;script language=&quot;JavaScript&quot;&gt;

 function autoResize(id){
  var newheight;
  var newwidth;

 if(document.getElementById){
  newheight=document.getElementById(id).contentWindow.document .body.scrollHeight;
  newwidth=document.getElementById(id).contentWindow.document .body.scrollWidth;
  }

 document.getElementById(id).height= parseInt(newheight) + 45 + &quot;px&quot;;
  document.getElementById(id).width= (newwidth) + &quot;px&quot;;
  }
  &lt;/script&gt;


&lt;iframe SRC=&quot;yourPage.html&quot; width=&quot;100%&quot; id=&quot;iframe1&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot; onLoad=&quot;autoResize('iframe1');&quot;&gt;&lt;/iframe&gt;
</pre>
<p>Save the above code as iframe.html, or whatever you like.<br />
Remember to create the file yourPage.html in the same folder as your previous html file.</p>
<p>I stumbled upon it on: <a href="ttp://www.programmingtalk.com/showthread.php?t=25995" rel="nofollow">this forum thread</a>.</p>
<p>I also did a little editing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.catzie.net/inline-frame-that-automatically-adjusts-its-height-for-the-source-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

