<?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>EeepZork!&#187; JavaScript</title>
	<atom:link href="http://labs.elektrikcoma.com/blog/category/code/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://labs.elektrikcoma.com/blog</link>
	<description>The unofficial offical comaLABS blog.</description>
	<lastBuildDate>Fri, 06 Nov 2009 07:24:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>using NOT abusing the CSS text-shadow property.</title>
		<link>http://labs.elektrikcoma.com/blog/code/using-not-abusing-the-css-text-shadow-property/</link>
		<comments>http://labs.elektrikcoma.com/blog/code/using-not-abusing-the-css-text-shadow-property/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 17:03:40 +0000</pubDate>
		<dc:creator>Mikael C. Fritts</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://labs.elektrikcoma.com/blog/?p=74</guid>
		<description><![CDATA[some browsers are currently supporting the CSS text-shadow property, although the others are slowly coming around. even though this property is technically part of the CSS level 3 library, more and more people are using it (and even more abusing it) everyday. here&#8217;s something that i find interesting that doesn&#8217;t abuse the property, but can [...]]]></description>
			<content:encoded><![CDATA[<p>some browsers are currently supporting the CSS text-shadow property, although the others are slowly coming around. even though this property is technically part of the CSS level 3 library, more and more people are using it (and even more abusing it) everyday. here&#8217;s something that i find interesting that doesn&#8217;t abuse the property, but can add more life to your page. </p>
<p>we&#8217;re going to use jQuery to add a the ability to make your elements glow on mouseover. any browser that doesn&#8217;t fully support the text-shadow property will still show the glow, but you won&#8217;t be able to add the &#8220;halo&#8221; effect. </p>
<p>so let&#8217;s get down to brass tacks shall we? all of the .js files you can download <a href="http://labs.elektrikcoma.com/blog/jq/glow/link_glow.rar">here</a> in a nice .rar file. there are a total of of three files you&#8217;ll need to call to make this bad boy work. </p>
<p><b>basic example</b><br />
<code><br />
$(document).ready(function() {<br />
  $('.glow-me').addGlow();<br />
});<br />
</code></p>
<p><b>advanced example</b><br />
<code><br />
$(document).ready(function() {<br />
  $('.glow-me').addGlow({<br />
    radius: 20,<br />
    textColor: '#ff0',<br />
    haloColor: '#ffa',<br />
    duration: 200<br />
  });<br />
});<br />
</code></p>
<p>you&#8217;ll want to customize your options in the <b>jquery-glowing.js</b> file. here&#8217;s the basic rundown:</p>
<li><b>textColor:</b> color the text should glow.
</li>
<li><b>haloColor: </b>halo color (for browsers that support it).
</li>
<li><b>radius:</b> controls the halo size (for browsers that support it).
</li>
<li><b>duration:</b> speed of the glowing effect.
<p><a href="http://labs.elektrikcoma.com/blog/jq/glow/demo.html" target="_blank"> Online demo is right here.</a></p>
</li>
]]></content:encoded>
			<wfw:commentRss>http://labs.elektrikcoma.com/blog/code/using-not-abusing-the-css-text-shadow-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>finally, i actually deliver what i said i would.</title>
		<link>http://labs.elektrikcoma.com/blog/code/finally-i-actually-deliver-what-i-said-i-would/</link>
		<comments>http://labs.elektrikcoma.com/blog/code/finally-i-actually-deliver-what-i-said-i-would/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 01:34:33 +0000</pubDate>
		<dc:creator>Mikael C. Fritts</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://labs.elektrikcoma.com/blog/?p=59</guid>
		<description><![CDATA[this script is pretty straight forward. some people may have uses for it, others may not. i created this for a specific request and i&#8217;m still making improvements to it. 
so here it is. a news scroll for your site! w00t! this is straight up JavaScript, so no plug-in&#8217;s or anything like that needed. works [...]]]></description>
			<content:encoded><![CDATA[<p>this script is pretty straight forward. some people may have uses for it, others may not. i created this for a specific request and i&#8217;m still making improvements to it. </p>
<p>so here it is. a news scroll for your site! w00t! this is straight up JavaScript, so no plug-in&#8217;s or anything like that needed. works in IE 5+ and FF 1+. it&#8217;s very simple to insert into your site. view the demo <a href="http://mymusicembassy.com/ticker/tickertest.html" target="_blank">HERE</a>. you can modify the look and feel all you want. more &lt;3 for CSS. let us get started shall we?</p>
<p>here be the JavaScript!!!</p>
<p><code><br />
//newsticker.js<br />
TICKER_CONTENT = document.getElementById("TICKER").innerHTML;</p>
<p>TICKER_RIGHTTOLEFT = false;<br />
TICKER_SPEED = 2;<br />
TICKER_STYLE = "font-family:Arial; font-size:12px; color:#FFFFFF";<br />
TICKER_PAUSED = false;</p>
<p>ticker_start();</p>
<p>function ticker_start() {<br />
	var tickerSupported = false;<br />
	TICKER_WIDTH = document.getElementById("TICKER").style.width;<br />
	var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0/>";</p>
<p>	// Firefox<br />
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {<br />
		document.getElementById("TICKER").innerHTML = "<br />
<table cellspacing='0' cellpadding='0' width='100%'>
<tr>
<td nowrap='nowrap'>"+img+"<span style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</span>"+img+"</td>
</tr>
</table>
<p>";<br />
		tickerSupported = true;<br />
	}<br />
	// IE<br />
	if (navigator.userAgent.indexOf("MSIE")!=-1 &#038;&#038; navigator.userAgent.indexOf("Opera")==-1) {<br />
		document.getElementById("TICKER").innerHTML = "
<div nowrap='nowrap' style='width:100%;'>"+img+"<span style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></span>"+img+"</div>
<p>";<br />
		tickerSupported = true;<br />
	}<br />
	if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {<br />
		document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;<br />
		document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;<br />
		document.getElementById("TICKER").style.display="block";<br />
		TICKER_tick();<br />
	}<br />
}</p>
<p>function TICKER_tick() {<br />
	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);<br />
	if(TICKER_RIGHTTOLEFT &#038;&#038; document.getElementById("TICKER").scrollLeft < = 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;<br />
	if(!TICKER_RIGHTTOLEFT &#038;&#038; document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) document.getElementById("TICKER").scrollLeft = 0;<br />
	window.setTimeout("TICKER_tick()", 30);<br />
}<br />
</code></p>
<p>to call the ticker to your page, the .JS DOES NOT go in the HEAD section of your document. it trails right below the actual content in the body. </p>
<p>EXAMPLE:<br />
<code><br />
&lt;div id="ticker" style="overflow:hidden; width:520px"  onmouseover="TICKER_PAUSED=true" onmouseout="TICKER_PAUSED=false"&gt;<br />
 This is news. As is this. And This. This is what will display in the actual ticker. And this as well. DO NOT USE &lt;br /&#038;gt tags as it will cause all kinds of crazy, unless that's what you're looking for. Feel free to add any HTML markup to seperate your "news" or what not.<br />
&lt;/div&gt;<br />
&lt;script type="text/javascript" src="newsticker.js" language="javascript"&gt;&lt;/script&gt;<br />
</code></p>
<p>make sure that the JS is being called correctly (absolute path would be nice). in this example, i have it set to pause when someone mouses over a headline, and un-pause on mouseout.  now let us edit some variable in the actual .JS to make it more &#8220;yours&#8221;.</p>
<p><b>TICKER_RIGHTTOLEFT</b></p>
<li>pretty self-explanatory. do you want it scrolling left to right or right to left?
<p><b>TICKER_SPEED</b>
</li>
<li>set the speed of the scroll. 1 = slowest, 10 = fastest
<p><b>TICKER_STYLE</b>
</li>
<li>set your styles here. font-family, color, all the fun stuff.
<p><b>TICKER_PAUSED</b>
</li>
<li>when this variable is set to true, the scrolling ticker is paused. this value can be changed at runtime, for example when the mouse is over the ticker.
<p>what i really use this for is to announce site news, via an RSS or XML feed. this is really easy to set-up. </p>
<p>instead of hard-coded text, we&#8217;re going to use a php include (you can use whatever suits your purpose). so in-between the DIV tags i put this:</p>
<p>< ? include "newsfeed.php" ?> //you can call this whatever you want</p>
<p>that file is just a php file that parses the data from an RSS or XML feed and converts it into plain HTML, thus letting the ticker read the new info. i find this to work the best, but that&#8217;s just me. </p>
<p>i&#8217;m not going into how to do this at this time, if you&#8217;re really lost, feel free to comment. the best solution would be using something like <a href="http://magpierss.sourceforge.net/" target="_blank">MagpieRSS</a> to help you with your parsing needs.</p>
<p>and with that, i&#8217;m going to go cry in my beer now. </p>
<p>until next time&#8230;.
</li>
]]></content:encoded>
			<wfw:commentRss>http://labs.elektrikcoma.com/blog/code/finally-i-actually-deliver-what-i-said-i-would/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a little &#8220;Web 2.0&#8243; on this chilly monday.</title>
		<link>http://labs.elektrikcoma.com/blog/code/a-little-web-20-on-this-chilly-monday/</link>
		<comments>http://labs.elektrikcoma.com/blog/code/a-little-web-20-on-this-chilly-monday/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 20:25:41 +0000</pubDate>
		<dc:creator>Mikael C. Fritts</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Web App]]></category>

		<guid isPermaLink="false">http://labs.elektrikcoma.com/blog/?p=36</guid>
		<description><![CDATA[Seeing as I tout myself as a UI Web Designer/Developer I decided to actually post something that is relevant to my &#8220;field&#8221;. I don&#8217;t really use this script that much myself, not because it&#8217;s not functional, just that I haven&#8217;t really had any projects that could benefit from it. 
So what is it already?
It&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Seeing as I tout myself as a UI Web Designer/Developer I decided to actually post something that is relevant to my &#8220;field&#8221;. I don&#8217;t really use this script that much myself, not because it&#8217;s not functional, just that I haven&#8217;t really had any projects that could benefit from it. </p>
<p>So what is it already?</p>
<p>It&#8217;s a simple tool tip script written in JavaScript (or DHTML if you will). Basically when your user mouses over a specified link a tool top will be displayed. You&#8217;ve seen this kind of script before, it&#8217;s actually pretty hard NOT to see it in use in today&#8217;s web world. I got tired of the regular &#8220;box&#8221; look and made it a bit more &#8220;Web 2.0&#8243;. Anyways, here comes the code. </p>
<p>All files are available in .rar format <a href="http://labs.elektrikcoma.com/bubble_tip.rar" title">here</a> and are free to download. Below I will explain the different aspects of the code and how to implement it. </p>
<p>The meat &#038; potato&#8217;s: The JavaScript.</p>
<p><code><br />
function showToolTip(e,text){<br />
	if(document.all)e = event;<br />
	var obj = document.getElementById('bubble_tooltip');<br />
	var obj2 = document.getElementById('bubble_tooltip_content');<br />
	obj2.innerHTML = text;<br />
	obj.style.display = 'block';<br />
	var st = Math.max(document.body.scrollTop,document.documentElement.scrollTop);<br />
	if(navigator.userAgent.toLowerCase().indexOf('safari')>=0)st=0;<br />
	var leftPos = e.clientX - 100;<br />
	if(leftPos&lt;0)leftPos = 0;<br />
	obj.style.left = leftPos + 'px';<br />
	obj.style.top = e.clientY - obj.offsetHeight -1 + st + 'px';<br />
}<br />
function hideToolTip()<br />
{<br />
document.getElementById('bubble_tooltip').style.display = 'none';<br />
}<br />
</code><br />
There really aren&#8217;t customizable variables in there, and I wouldn&#8217;t recommend changing anything unless you have a working knowledge of JavaScript. Make sure you include the JS file in the &lt;head&gt; of your document!</p>
<p>The customizable part: CSS.</p>
<p><code><br />
#bubble_tooltip{<br />
	width: 147px;<br />
	position: absolute;<br />
	display: none;<br />
}<br />
#bubble_tooltip .bubble_top{<br />
	background-image: url('../images/bubble_top.gif'); /*DEFINE THIS PATH!!! */<br />
	background-repeat: no-repeat;<br />
	height: 16px;<br />
}<br />
#bubble_tooltip .bubble_middle{<br />
	background-image: url('../images/bubble_middle.gif'); /*DEFINE THIS PATH!!! */<br />
	background-position: bottom left;<br />
	padding-left: 7px;<br />
	padding-right: 7px;<br />
}<br />
#bubble_tooltip .bubble_middle span{<br />
	position: relative;<br />
	top: -8px;<br />
	font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;<br />
	font-size: 11px;<br />
}<br />
#bubble_tooltip .bubble_bottom{<br />
	background-image: url('../images/bubble_bottom.gif'); /*DEFINE THIS PATH!!! */<br />
	background-repeat: no-repeat;<br />
	background-repeat: no-repeat;<br />
	height: 44px;<br />
	position: relative;<br />
	top: -6px;<br />
}<br />
</code><br />
Add the above CSS into your pre-existing CSS file. Modify the colors, font face, font size, etc&#8230; Make SURE you upload the image files to a specified directory and make sure your CSS reflects that. </p>
<p>Now implement the tool tip in your page. This can be used in an anchor tag or a span tag. I&#8217;ve included examples of both. </p>
<p>Using it with an anchor tag:<br />
<code><br />
&lt;a href="page.html" onmousemove="showToolTip(event,'This is where your text will go. Change at will!');return false" onmouseout="hideToolTip()">Focus Word&lt;/a&gt;<br />
</code>  </p>
<p>Using it with a span:<br />
<code><br />
&lt;span class="tooltip_text" href="page.html" onmousemove="showToolTip(event,'This is where your text will go. Change at will!');return false" onmouseout="hideToolTip()">Focus Word&lt;/span&gt;<br />
</code></p>
<p>There you have it.</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.elektrikcoma.com/blog/code/a-little-web-20-on-this-chilly-monday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In the works&#8230;</title>
		<link>http://labs.elektrikcoma.com/blog/code/in-the-works/</link>
		<comments>http://labs.elektrikcoma.com/blog/code/in-the-works/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 03:16:28 +0000</pubDate>
		<dc:creator>Mikael C. Fritts</dc:creator>
				<category><![CDATA[API's]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[XHTML & CSS]]></category>
		<category><![CDATA[Geekout!]]></category>
		<category><![CDATA[in the works]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[Web App]]></category>

		<guid isPermaLink="false">http://labs.elektrikcoma.com/blog/?p=30</guid>
		<description><![CDATA[So I'm working on a script that takes advantage of the (that sounds so very, very wrong) <a href="http://www.mootools.net/" target="_blank">MooTools</a> JavaScript framework to create an application like the <a href="http://www.huddletogether.com/projects/lightbox/" target="_blank">Lightbox JavaScript</a> app, only much more powerful. ]]></description>
			<content:encoded><![CDATA[<p>So I spent most of today in the breadline, looking for a job. Apparently in this market there is no room for Front End UI Developers/Designers. Go USA!</p>
<p>So I&#8217;m working on a script that takes advantage of the (that sounds so very, very wrong) <a href="http://www.mootools.net/" target="_blank">MooTools</a> JavaScript framework to create an application like the <a href="http://www.huddletogether.com/projects/lightbox/" target="_blank">Lightbox JavaScript</a> app, only much more powerful. </p>
<p>Why? Well, why not? Also, and by no means do I mean to discredit Lokesh Dhakar&#8217;s (he wrote Lightbox) awesome code, I just vision it doing more powerful things, not just show pictures. As I was researching, I found that someone else has already jumped ahead of me with this same vision. That person would be John Einselen from <a href="http://iaian7.com/" target="_blank">iaian7.com</a>. He&#8217;s already done some amazing work and I&#8217;ll be standing on his shoulders as I modify and tweak code, and of course will give him credit where credit is very much do. </p>
<p>So what is this app going to be? Imagine having the same &#8220;lightbox effect&#8221; only instead of applying just to images, it would be used for pretty much anything you can imagine. Here&#8217;s just a small sample list of what I&#8217;ve got in mind:<br />
Flash<br />
Video (almost all formats)<br />
Images (dur)<br />
Web Pages<br />
Audio</p>
<p>PLUS!!!</p>
<p>The ability to read you Flickr stream, Google and YouTube Video, MySpace, Facebook, Veoh, MetaCafe, and others. All you&#8217;ll have to do is modify your link, embedded or not. Just one simple statement and there ya go! </p>
<p>ACTUALLY&#8230;</p>
<p>It&#8217;s not going to be THAT easy, but it will be easy enough. Just a couple of scripts that need to be uploaded to you server, a few lines of code added to your HEAD section, and you&#8217;ll be done. </p>
<p>RELEASE&#8230;</p>
<p>I&#8217;m planning on working on it this weekend, and will hopefully have it up early next week. Until then, if you just CANNOT WAIT, check out iaian7&#8217;s app on his page listed above. </p>
<p>Time for beer and hockey.</p>
<p>Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://labs.elektrikcoma.com/blog/code/in-the-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
