<?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>Utah WordPress Web Design &#187; javascript</title>
	<atom:link href="http://www.brmecham.com/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brmecham.com</link>
	<description>Brian Mecham, Utah Web Designer, WordPress Theme Developer, WordPress Templates, CSS Ninja</description>
	<lastBuildDate>Thu, 22 Dec 2011 00:21:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How to Create a Simple Javascript popup window</title>
		<link>http://www.brmecham.com/how-to-create-a-simple-javascript-popup-window/</link>
		<comments>http://www.brmecham.com/how-to-create-a-simple-javascript-popup-window/#comments</comments>
		<pubDate>Wed, 12 May 2010 18:01:42 +0000</pubDate>
		<dc:creator>Brian Mecham</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[hyperlink]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[popup]]></category>

		<guid isPermaLink="false">http://www.brmecham.com/?p=120</guid>
		<description><![CDATA[Sometimes on your website you may want to open some content in a popup window rather than a new page, which allows the visitor to remain on the current page and view the new content. Here&#8217;s how you do this&#8230; Add the following javascript code to the header of your website (somewhere in between the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-125" title="javascript popup" src="http://www.brmecham.com/wp-content/uploads/2010/05/javascript-popup.png" alt="javascript popup" width="428" height="176" /><br />
Sometimes on your website you may want to open some content in a popup window rather than a new page, which allows the visitor to remain on the current page and view the new content.</p>
<p><strong>Here&#8217;s how you do this&#8230;</strong></p>
<p>Add the following javascript code to the header of your website (somewhere in between the &lt;head&gt; &lt;/head&gt; tags)&#8230;</p>
<pre>&lt;script language="javascript" type="text/javascript"&gt;
&lt;!-- POPUP WINDOW SCRIPT --&gt;
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.availWidth)?Math.floor(Math.random()*(screen.availWidth-w)):50;TopPosition=(screen.availHeight)?Math.floor(Math.random()*((screen.availHeight-h)-75)):50;}
if(pos=="center"){LeftPosition=(screen.availWidth)?(screen.availWidth-w)/2:50;TopPosition=(screen.availHeight)?(screen.availHeight-h)/2:50;}
if(pos=="default"){LeftPosition=50;TopPosition=50}
else if((pos!="center" &amp;&amp; pos!="random" &amp;&amp; pos!="default") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
if(win.focus){win.focus();}}
function CloseNewWin(){if(win!=null &amp;&amp; win.open)win.close()}
window.onfocus=CloseNewWin;
&lt;!-- POPUP WINDOW SCRIPT --&gt;
&lt;/script&gt;</pre>
<p>Now place the following code on your website, like a normal hyperlink but with some extra code. Edit this line according to the link you are wanting to open&#8230;</p>
<pre>&lt;a href="http://www.yoursite.com/awebpage.php" onClick="NewWindow(this.href,'TitleGoesHere','550','400','yes','center');return false" onFocus="this.blur()"&gt;OpenThisPage&lt;/a&gt;</pre>
<p>That&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brmecham.com/how-to-create-a-simple-javascript-popup-window/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

