<?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>Web Style Press, Best Practices from all the Web, Build Better Websites &#187; js</title>
	<atom:link href="http://www.webstylepress.com/tag/js/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webstylepress.com</link>
	<description>Web VS Style</description>
	<lastBuildDate>Mon, 26 Dec 2011 10:35:53 +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>Use Any Font in Webpages As Text</title>
		<link>http://www.webstylepress.com/use-any-font-in-webpages-as-text/</link>
		<comments>http://www.webstylepress.com/use-any-font-in-webpages-as-text/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 10:06:43 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[Advanced]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[essential]]></category>
		<category><![CDATA[facelift]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[smoothness]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[typeface]]></category>

		<guid isPermaLink="false">http://www.webstylepress.com/?p=481</guid>
		<description><![CDATA[Now using javascript we can use any font in web page by using techniques such as Typeface and Facelift Image Replacement (or FLIR) or sIFR. sIFR needs flash while others do not. sIFR is for smoothness look of fonts. Instead of creating images or using flash just to show your site&#8217;s graphic text in the [...]<p><a href="http://www.webstylepress.com/use-any-font-in-webpages-as-text/">Use Any Font in Webpages As Text</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" target="_blank" href="http://nettuts.com/javascript-ajax/how-to-use-any-font-you-wish-with-flir/"><img src="http://www.webstylepress.com/wp-content/uploads/2009/01/use-any-fonts.png" alt="use-any-fonts" title="use-any-fonts" width="490" height="440" class="alignnone size-full wp-image-493" /></a></p>
<p>Now using javascript we can use any font in web page by using techniques such as <strong>Typeface</strong> and <strong>Facelift Image Replacement</strong> (or FLIR) or <strong>sIFR</strong>. sIFR needs flash while others do not. sIFR is for smoothness look of fonts.</p>
<p>Instead of creating images or using flash just to show your site&#8217;s graphic text in the font you want, you can use typeface.js and write in plain HTML and CSS and get original smooth font look whatever you specify, even if the user machine have not those fonts. This technique is limited yet with limited fonts support and also it is recommended to use it for title of headings of web page. All the font at the web page using this technique can heavy things up at server and page might load very slow. Even then it is cool. Type face is easy, flexible and open source.</p>
<p><span id="more-481"></span></p>
<p>Using FLIR to display any font in web page is even easy. <a rel="nofollow" target="_blank" href="http://nettuts.com/javascript-ajax/how-to-use-any-font-you-wish-with-flir/" target="_blank">Here</a> they have got complete instructions for just that.</p>
<p>I have tried type face method and here is its example to download.</p>
<p><a href='http://www.webstylepress.com/use-any-font-in-webpages-as-text/type-face/' rel='attachment wp-att-490' class="download">Type Face Example Download</a></p>
<p><strong>Related Resources </strong></p>
<p><a rel="nofollow" target="_blank" href="http://facelift.mawhorter.net/">Facelift</a><br />
<a rel="nofollow" target="_blank" href="http://novemberborn.net/">Novemberborn</a><br />
<a rel="nofollow" target="_blank" href="http://nettuts.com/javascript-ajax/how-to-implement-sifr3-into-your-website/">Implementing sIFR for smoothness of fonts in webpages</a><br />
<a rel="nofollow" target="_blank" href="http://typeface.neocracy.org">http://typeface.neocracy.org</a><br />
<a rel="nofollow" target="_blank" href="http://nettuts.com/javascript-ajax/how-to-use-any-font-you-wish-with-flir/">http://nettuts.com/javascript-ajax/how-to-use-any-font-you-wish-with-flir/</a></p>
<p><a href="http://www.webstylepress.com/use-any-font-in-webpages-as-text/">Use Any Font in Webpages As Text</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.webstylepress.com/lorem-ipsum-ready/" title="Lorem ipsum Ready to Use">Lorem ipsum Ready to Use</a></li><li><a href="http://www.webstylepress.com/change-image-opacity-easily-using-css-js/" title="Change Image Opacity Easily Using CSS or JS">Change Image Opacity Easily Using CSS or JS</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-6/" title="Javascript Essentials Part 6">Javascript Essentials Part 6</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-5/" title="Javascript Essentials Part 5">Javascript Essentials Part 5</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-4/" title="Javascript Essentials Part 4">Javascript Essentials Part 4</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-3/" title="Javascript Essentials Part 3">Javascript Essentials Part 3</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-2/" title="Javascript Essentials Part 2">Javascript Essentials Part 2</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-1/" title="Javascript Essentials Part 1">Javascript Essentials Part 1</a></li><li><a href="http://www.webstylepress.com/simple-rollover-swap-image/" title="Simple RollOver Swap Image">Simple RollOver Swap Image</a></li><li><a href="http://www.webstylepress.com/modern-font-styles-for-websites/" title="Modern Font Styles For Websites">Modern Font Styles For Websites</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.webstylepress.com/use-any-font-in-webpages-as-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Image Opacity Easily Using CSS or JS</title>
		<link>http://www.webstylepress.com/change-image-opacity-easily-using-css-js/</link>
		<comments>http://www.webstylepress.com/change-image-opacity-easily-using-css-js/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 09:14:06 +0000</pubDate>
		<dc:creator>Hiroshi</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[blur]]></category>
		<category><![CDATA[effects]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[image effects]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[moz]]></category>
		<category><![CDATA[ns6]]></category>
		<category><![CDATA[opacity]]></category>

		<guid isPermaLink="false">http://www.webstylepress.com/?p=484</guid>
		<description><![CDATA[We can simply use CSS alone to reproduce opacity effect that have traditionally been done using scripting. The advantage of looking to CSS instead is obvious &#8211; much more lightweight and easier to implement. We can use this method where we need to use a dim or faint version of image, while when some one [...]<p><a href="http://www.webstylepress.com/change-image-opacity-easily-using-css-js/">Change Image Opacity Easily Using CSS or JS</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
]]></description>
			<content:encoded><![CDATA[<p>We can simply use CSS alone to reproduce opacity effect that have traditionally been done using scripting. The advantage of looking to CSS instead is obvious &#8211; much more lightweight and easier to implement. We can use this method where we need to use a dim or faint version of image, while when some one places mouse over it, then image comes sharp, clear and bright.</p>
<p><span id="more-484"></span></p>
<p>Use the following code in head section of web page.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">&lt;style type<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span><span style="color: #00AA00;">&gt;</span>
<span style="color: #6666ff;">.opacityit</span> img<span style="color: #00AA00;">&#123;</span>
filter<span style="color: #3333ff;">:progid</span><span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span>.Alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">40</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0.4</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.opacityit</span><span style="color: #3333ff;">:hover </span>img<span style="color: #00AA00;">&#123;</span>
filter<span style="color: #3333ff;">:progid</span><span style="color: #3333ff;">:DXImageTransform</span><span style="color: #6666ff;">.Microsoft</span>.Alpha<span style="color: #00AA00;">&#40;</span>opacity<span style="color: #00AA00;">=</span><span style="color: #cc66cc;">100</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
-moz-opacity<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></div>

<p>Use the following code in body where the image is located.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;#&quot; class=&quot;opacityit&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;email.gif&quot; /&gt;&lt;/a&gt;</pre></div></div>

<p>By this method image loads kind of blur in background and in light colors, but when some one places mouse over it. It becomes sharp.</p>
<p><strong>Simple Opacity</strong></p>
<p>We are using JavaScript to change the opacity of an image here. The technique works in both IE4+ and NS6+, and can be used to create some interesting &#8220;fading&#8221; effects. Here is the simple way to just place an image with opacity.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;image.gif&quot; style=&quot;filter:alpha(opacity=50); -moz-opacity:0.5&quot;&gt;</pre></div></div>

<p>In <strong>-moz-opacity:0.5</strong> accepted range of values are 0 to 1, where 0 would make the image disappear and in <strong>alpha(opacity=50)</strong> range is between  1 to 100. We have combined the code both for IE and Mozilla for code compatibility.</p>
<p>We can also alter the opacity of image using javascript.</p>
<p><strong>Head section code</strong></p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">function</span> alteropacity<span style="color: #009900;">&#40;</span>imageobject<span style="color: #339933;">,</span> opacity<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
 <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appName</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Netscape&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=-</span><span style="color: #CC0000;">1</span>
  <span style="color: #339933;">&amp;&amp;</span>parseInt<span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appVersion</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #CC0000;">5</span><span style="color: #009900;">&#41;</span>
    imageobject.<span style="color: #660066;">style</span>.<span style="color: #660066;">MozOpacity</span><span style="color: #339933;">=</span>opacity<span style="color: #339933;">/</span><span style="color: #CC0000;">100</span>
 <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appName</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Microsoft&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">1</span> 
  <span style="color: #339933;">&amp;&amp;</span>parseInt<span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appVersion</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span>
    imageobject.<span style="color: #660066;">filters</span>.<span style="color: #660066;">alpha</span>.<span style="color: #660066;">opacity</span><span style="color: #339933;">=</span>opacity
<span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p><strong>Body Section Code</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;img src=&quot;image.gif&quot; style=&quot;filter:alpha(opacity=50); -moz-opacity:0.5&quot; 
onMouseover=&quot;alteropacity(this, 100)&quot; onMouseout=&quot;alteropacity(this, 30)&quot;&gt;</pre></div></div>

<p><a href="http://www.webstylepress.com/change-image-opacity-easily-using-css-js/">Change Image Opacity Easily Using CSS or JS</a> is a post from: <a href="http://www.webstylepress.com">Web Style Press, Best Practices from all the Web, Build Better Websites</a></p>
<h2  class="related_post_title">Related Posts</h2><ul class="related_post"><li><a href="http://www.webstylepress.com/use-any-font-in-webpages-as-text/" title="Use Any Font in Webpages As Text">Use Any Font in Webpages As Text</a></li><li><a href="http://www.webstylepress.com/css-maximum-benefits/" title="How to Gain Maximum from CSS">How to Gain Maximum from CSS</a></li><li><a href="http://www.webstylepress.com/advanced-js-calendar/" title="Advanced JS Calendar">Advanced JS Calendar</a></li><li><a href="http://www.webstylepress.com/simple-js-calendar/" title="Create Simple Javascript Based Calendar">Create Simple Javascript Based Calendar</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-6/" title="Javascript Essentials Part 6">Javascript Essentials Part 6</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-5/" title="Javascript Essentials Part 5">Javascript Essentials Part 5</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-4/" title="Javascript Essentials Part 4">Javascript Essentials Part 4</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-3/" title="Javascript Essentials Part 3">Javascript Essentials Part 3</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-2/" title="Javascript Essentials Part 2">Javascript Essentials Part 2</a></li><li><a href="http://www.webstylepress.com/javascript-essentials-part-1/" title="Javascript Essentials Part 1">Javascript Essentials Part 1</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.webstylepress.com/change-image-opacity-easily-using-css-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

