<?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>htmOwl | Web Development, Chicago</title> <atom:link href="http://www.htmowl.com/feed/" rel="self" type="application/rss+xml" /><link>http://www.htmowl.com</link> <description>Web services based in the Windy City.</description> <lastBuildDate>Wed, 01 Apr 2015 17:24:49 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>https://wordpress.org/?v=4.7.8</generator> <site xmlns="com-wordpress:feed-additions:1">46395698</site>	<item><title>HTML: Headings &#8211; h tags</title><link>http://www.htmowl.com/blog/html-headers-h-tags/</link> <pubDate>Wed, 20 Nov 2013 17:01:55 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[HTML]]></category><guid isPermaLink="false">http://www.htmowl.com/?p=598</guid> <description><![CDATA[<p>Heading tags in HTML are used to specify titles of websites, sections and articles. Heading tags are often seen paired with paragraph tags like this example: HTML provides six different heading tags (&#60;h1&#62;,&#60;h2&#62;,&#60;h3&#62;,&#60;h4&#62;,&#60;h5&#62;,&#60;h6&#62;) which should be used to specify information hierarchy on a web page. The &#60;h1&#62; tag, for example, should be used for the [&#8230;]</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/html-headers-h-tags/">HTML: Headings &#8211; h tags</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Heading tags in HTML are used to specify titles of websites, sections and articles.</p><p>Heading tags are often seen paired with <a href="http://www.htmowl.com/blog/html-paragraphs-p-tag/" title="Paragraph tag">paragraph tags</a> like this example:</p><pre class="brush: xml; title: ; notranslate">&lt;h1&gt;This is a headline&lt;/h1&gt;

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobortis&lt;/p&gt;</pre><p>HTML provides six different heading tags (&lt;h1&gt;,&lt;h2&gt;,&lt;h3&gt;,&lt;h4&gt;,&lt;h5&gt;,&lt;h6&gt;) which should be used to specify information hierarchy on a web page.</p><p>The &lt;h1&gt; tag, for example, should be used for the most important heading on a page and is generally reserved for site names and web page titles. It should only be used once on a page.</p><p>If the &lt;h1&gt; tag is used for the site name, an &lt;h2&gt; tag could be used for the page title (i.e. Blog). Then, if sticking with the blog example, the headline for each blog post&#8217;s could be &lt;h3&gt; tags.</p><pre class="brush: xml; title: ; notranslate">&lt;h1&gt;htmOwl&lt;/h1&gt;

&lt;h2&gt;Blog&lt;/h2&gt;

&lt;h3&gt;HTML: Headings - h tags&lt;/h3&gt;

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobor&lt;/p&gt;

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobor&lt;/p&gt;

&lt;h3&gt;HTML: Paragraphs - p tags&lt;/h3&gt;

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobor&lt;/p&gt;

&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur lobor&lt;/p&gt;</pre><p>The headings hierarchy would continue down the page. If a sidebar existed, one might use &lt;h4&gt; tags for the titles of the sidebar sections. And &lt;h5&gt; could be used for headings in footer content.</p><p>For more information about heading tags, <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements" title="Heading Elements - MDN" target="_blank">visit the MDN</a>.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/html-headers-h-tags/">HTML: Headings &#8211; h tags</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">598</post-id>	</item> <item><title>Use MDN for reference, skip W3Schools</title><link>http://www.htmowl.com/blog/use-mdn-reference-skip-w3schools/</link> <pubDate>Fri, 15 Nov 2013 15:30:37 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[JavaScript]]></category><guid isPermaLink="false">http://www.htmowl.com/?p=593</guid> <description><![CDATA[<p>Budding developers should get in the habit of referencing the Mozilla Developer Network for quick HTML and CSS tag queries, as opposed to using W3Schools. W3Schools, despite its commonly high rankings in search results, has a bad reputation in the development community for providing incomplete or incorrect information. Despite sharing a name and domain that [&#8230;]</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/use-mdn-reference-skip-w3schools/">Use MDN for reference, skip W3Schools</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Budding developers should get in the habit of referencing the <a href="https://developer.mozilla.org/" title="MDN" target="_blank">Mozilla Developer Network</a> for quick HTML and CSS tag queries, as opposed to using <a href="http://www.w3schools.com" target="_blank">W3Schools</a>.</p><p>W3Schools, despite its commonly high rankings in search results, has a bad reputation in the development community for providing incomplete or incorrect information. Despite sharing a name and domain that appear to be related to the <a href="http://www.w3.org" title="World Wide Web Consortium" target="_blank">World Wide Web Consortium</a>, the site has no affiliation.</p><p>The MDN is provided by Mozilla, the guys behind Firefox, and is a solid source for HTML, CSS and Javascript documentation.</p><p>For jQuery information, <a href="http://api.jquery.com" title="jQuery" target="_blank">go directly to the source</a>. Do the same <a href="http://www.php.net" title="PHP" target="_blank">with PHP</a>.</p><p>Those looking for entry level tutorials and exercises may also be interested in <a href="http://www.htmowl.com/blog/best-resources-for-aspiring-web-developers/" title="Best Resources for Aspiring Web Developers" target="_blank">these recommendations</a>.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/use-mdn-reference-skip-w3schools/">Use MDN for reference, skip W3Schools</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">593</post-id>	</item> <item><title>HTML: Paragraphs &#8211; p tag</title><link>http://www.htmowl.com/blog/html-paragraphs-p-tag/</link> <comments>http://www.htmowl.com/blog/html-paragraphs-p-tag/#comments</comments> <pubDate>Thu, 14 Nov 2013 17:16:40 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[HTML]]></category><guid isPermaLink="false">http://www.htmowl.com/?p=578</guid> <description><![CDATA[<p>In HTML, the p tag defines a paragraph. It is used to wrap a group of sentences. The tag is opened at the beginning of a paragraph and closed at the end. In HTML, tags are closed by preceding the tag with a forward slash: &#8220;/&#8221;. HTML tags are wrapped in angle brackets. A group [&#8230;]</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/html-paragraphs-p-tag/">HTML: Paragraphs &#8211; p tag</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>In HTML, the p tag defines a paragraph.</p><p>It is used to wrap a group of sentences. The tag is opened at the beginning of a paragraph and closed at the end. In HTML, tags are closed by preceding the tag with a forward slash: &#8220;/&#8221;. HTML tags are wrapped in angle brackets.</p><pre class="brush: xml; title: ; notranslate">&lt;p&gt;This is a paragraph&lt;/p&gt;

&lt;p&gt;This is another paragraph&lt;/p&gt;</pre><p>A group of text wrapped in a p tag may stand alone, but is often seen following a heading tag.</p><p>For deeper information on the p tag, <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p" title="p tag on MDN" target="_blank">consult the Mozilla Developer Network</a>.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/html-paragraphs-p-tag/">HTML: Paragraphs &#8211; p tag</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.htmowl.com/blog/html-paragraphs-p-tag/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <post-id xmlns="com-wordpress:feed-additions:1">578</post-id>	</item> <item><title>jCarousel: Vertical scroll with multiple items</title><link>http://www.htmowl.com/blog/jcarousel-vertical-scroll-with-multiple-items/</link> <comments>http://www.htmowl.com/blog/jcarousel-vertical-scroll-with-multiple-items/#comments</comments> <pubDate>Fri, 05 Apr 2013 19:21:52 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[jCarousel]]></category><guid isPermaLink="false">http://www.htmowl.com/?p=407</guid> <description><![CDATA[<p><a href="http://sorgalla.com/projects/jcarousel/" title="jCarousel">jCarousel</a> is a useful plugin for quickly adding a carousel to a site. Using the plugin's built-in configuration options you can quickly set up a horizontal or vertical carousel.</p><p>Horizontal carousels scroll left and right in a single row. Vertical carousels scroll up and down in a single column.</p><p>But what if you want horizontally positioned carousel with multiple items to scroll up and down?</p><p>Start by expanding the "jcarousel-clip-vertical" css rule to a width that will allow your items to properly fill the space.</p><p>I used images that all shared a width of 111px and wanted to show three images at a time, so I set the clip to a width of 333px.</p><p>In the jCarousel configuration settings, set vertical to true so that your images will scroll up. The plugin auto calculates the number of total scrolls to allow based on the number of items in the carousel list, so that calculation needs to be adjusted. <a href="http://www.htmowl.com/blog/jcarousel-vertical-scroll-with-multiple-items/">>></a></p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/jcarousel-vertical-scroll-with-multiple-items/">jCarousel: Vertical scroll with multiple items</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p><a href="http://sorgalla.com/projects/jcarousel/" title="jCarousel">jCarousel</a> is a useful plugin for quickly adding a carousel to a site. Using the plugin&#8217;s built-in configuration options you can quickly set up a horizontal or vertical carousel.</p><p>Horizontal carousels scroll left and right in a single row. Vertical carousels scroll up and down in a single column.</p><p>But what if you want horizontally positioned carousel with multiple items to scroll up and down?</p><p>Start by expanding the &#8220;jcarousel-clip-vertical&#8221; css rule to a width that will allow your items to properly fill the space.</p><p>I used images that all shared a width of 111px and wanted to show three images at a time, so I set the clip to a width of 333px.</p><p>In the jCarousel configuration settings, set vertical to true so that your images will scroll up. The plugin auto calculates the number of total scrolls to allow based on the number of items in the carousel list, so that calculation needs to be adjusted.</p><p>Using the size property, overwrite the value with the total number of rows.</p><pre class="brush: jscript; title: ; notranslate">jQuery(document).ready(function() {
		    jQuery('#mycarousel').jcarousel({
		    	vertical:true,
		    	size: 2 //Change to match total number of rows.
		    });
		});
</pre><p>This approach will do in a pinch but a better way would be to grab the size value and simply divide it by the number of items you want in each row. It would allow you to change the number of list items on the fly without having to manually adjust the size value.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/jcarousel-vertical-scroll-with-multiple-items/">jCarousel: Vertical scroll with multiple items</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.htmowl.com/blog/jcarousel-vertical-scroll-with-multiple-items/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <post-id xmlns="com-wordpress:feed-additions:1">407</post-id>	</item> <item><title>Convenient tool for quick font stack browsing</title><link>http://www.htmowl.com/blog/convenient-tool-for-quick-font-stack-browsing/</link> <pubDate>Tue, 05 Feb 2013 20:48:36 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Fonts]]></category><guid isPermaLink="false">http://www.htmowl.com/?p=353</guid> <description><![CDATA[<p>Font stacks can be a little confusing for aspiring developers or designers.</p><p>Which fonts are safe for the Web? What font should you use behind Tahoma as a fall back? Papyrus will work on Macs?</p><p><a href="http://cssfontstack.com" title="CSS Font Stack">CSS Font Stack</a> offers a convenient reference for beginning developers as well as veterans.</p><p>While browsing the font list, font names are displayed using the suggested font stack so you may browser test on the fly.</p><p>Each font offers a convenient "Copy to Clipboard" button. Font stack details can be viewed by hovering over a magnifying glass icon and browser use percentages are offered via an info icon.</p><p>The font Papyrus, for instance, is used in 92.43% of Macs and 70.37% of Windows machines according to the site.</p><p>Of course, always be sure to test your project in all browsers to confirm the fonts behave as expected.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/convenient-tool-for-quick-font-stack-browsing/">Convenient tool for quick font stack browsing</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Font stacks can be a little confusing for aspiring developers or designers.</p><p>Which fonts are safe for the Web? What font should you use behind Tahoma as a fall back? Papyrus will work on Macs?</p><p><a href="http://cssfontstack.com" title="CSS Font Stack">CSS Font Stack</a> offers a convenient reference for beginning developers as well as veterans.</p><p>While browsing the font list, font names are displayed using the suggested font stack so you may browser test on the fly.</p><p>Each font offers a convenient &#8220;Copy to Clipboard&#8221; button. Font stack details can be viewed by hovering over a magnifying glass icon and browser use percentages are offered via an info icon.</p><p>The font Papyrus, for instance, is used in 92.43% of Macs and 70.37% of Windows machines according to the site.</p><p>Of course, always be sure to test your project in all browsers to confirm the fonts behave as expected.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/convenient-tool-for-quick-font-stack-browsing/">Convenient tool for quick font stack browsing</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">353</post-id>	</item> <item><title>Facebook like button hates popping up</title><link>http://www.htmowl.com/blog/facebook-like-button-hates-popping-up/</link> <pubDate>Thu, 27 Dec 2012 20:29:25 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Facebook]]></category><guid isPermaLink="false">http://www.rickmarkus.com/?p=316</guid> <description><![CDATA[<p>A recent client asked me to intall a popup box on his site that contained <a href="http://developers.facebook.com/docs/reference/plugins/like/" title="Facebook Like Button" target="_blank">Facebook's like button</a>.</p><p>I wrapped the like button in a div and set the div to display:none. Using jQuery's show() or fadeIn() functions worked fine on the box itself, but the like button was behaving inconsistently across browsers. In Firefox I believe it disappeared completely.</p><p>The solution, which is actually more of a workaround, is to keep the wrapping div visible, but set it's margin outside the view of the window. I ended up absolutely positioning the div so that it's right CSS property was -500 pixels and then using jQuery's animate() function, I slid the box in so that it rested with a right property of 20 pixels or so.</p><p>The Facebook button liked that setup.</p><p>Hopefully somebody finds this and saves themselves a few minutes of troubleshooting.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/facebook-like-button-hates-popping-up/">Facebook like button hates popping up</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>A recent client asked me to intall a popup box on his site that contained <a href="http://developers.facebook.com/docs/reference/plugins/like/" title="Facebook Like Button" target="_blank">Facebook&#8217;s like button</a>.</p><p>I wrapped the like button in a div and set the div to display:none. Using jQuery&#8217;s show() or fadeIn() functions worked fine on the box itself, but the like button was behaving inconsistently across browsers. In Firefox I believe it disappeared completely.</p><p>The solution, which is actually more of a workaround, is to keep the wrapping div visible, but set it&#8217;s margin outside the view of the window. I ended up absolutely positioning the div so that it&#8217;s right CSS property was -500 pixels and then using jQuery&#8217;s animate() function, I slid the box in so that it rested with a right property of 20 pixels or so.</p><p>The Facebook button liked that setup.</p><p>Hopefully somebody finds this and saves themselves a few minutes of troubleshooting.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/facebook-like-button-hates-popping-up/">Facebook like button hates popping up</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">316</post-id>	</item> <item><title>Common culprit for a sluggish WordPress site</title><link>http://www.htmowl.com/blog/common-culprit-for-a-sluggish-wordpress-site/</link> <pubDate>Tue, 30 Oct 2012 21:29:42 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[Plugins]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://www.rickmarkus.com/?p=273</guid> <description><![CDATA[<p>Many factors can affect the loading speed of a WordPress site, but in my experience it usually boils down to plugins.</p><p>WordPress is an excellent CMS in no small part due to its ease of customization. As users explore the full spectrum of possibilities, it's easy to find oneself with a host of plugins that were added after the installation of the WordPress core files.</p><p>Simply put: less is more.</p><p>Most plugins will slow your site's load time. Only install and activate plugins that are absolutely necessary.</p><p>Can plugins slow down your site even if they are deactivated? Some <a href="http://www.wpsecuritylock.com/are-your-wordpress-plugins-making-your-site-slow-and-vulnerable/" title="Deactivated plugins slow down your WordPress site" target="_blank">say yes</a>. Others <a href="http://www.webproworld.com/webmaster-forum/threads/107180-Inactive-wordpress-plugins" title="Deactivated plugins do not slow down your site" target="_blank">say no</a>.</p><p>I tend to think that if a plugin is installed but deactivated, it can likely be deleted. Make it a best practice.</p><p>If you want to run some plugin load testing, developer Dave Clements <a href="http://www.doitwithwp.com/find-bulkiest-wordpress-plugins/" title="Analyze plugin load time with the P# Plugin Performance Profiler" target="_blank">suggests the P3 Plugin Performance Profiler</a> and details its usage.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/common-culprit-for-a-sluggish-wordpress-site/">Common culprit for a sluggish WordPress site</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Many factors can affect the loading speed of a WordPress site, but in my experience it usually boils down to plugins.</p><p>WordPress is an excellent CMS in no small part due to its ease of customization. As users explore the full spectrum of possibilities, it&#8217;s easy to find oneself with a host of plugins that were added after the installation of the WordPress core files.</p><p>Simply put: less is more.</p><p>Most plugins will slow your site&#8217;s load time. Only install and activate plugins that are absolutely necessary.</p><p>Can plugins slow down your site even if they are deactivated? Some <a href="http://www.wpsecuritylock.com/are-your-wordpress-plugins-making-your-site-slow-and-vulnerable/" title="Deactivated plugins slow down your WordPress site" target="_blank">say yes</a>. Others <a href="http://www.webproworld.com/webmaster-forum/threads/107180-Inactive-wordpress-plugins" title="Deactivated plugins do not slow down your site" target="_blank">say no</a>.</p><p>I tend to think that if a plugin is installed but deactivated, it can likely be deleted. Make it a best practice.</p><p>If you want to run some plugin load testing, developer Dave Clements <a href="http://www.doitwithwp.com/find-bulkiest-wordpress-plugins/" title="Analyze plugin load time with the P# Plugin Performance Profiler" target="_blank">suggests the P3 Plugin Performance Profiler</a> and details its usage.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/common-culprit-for-a-sluggish-wordpress-site/">Common culprit for a sluggish WordPress site</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">273</post-id>	</item> <item><title>JavaScript &#8216;Click Me&#8217; prank for beginners</title><link>http://www.htmowl.com/blog/javascript-click-me-prank-beginners/</link> <pubDate>Fri, 22 Jun 2012 19:58:22 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[JavaScript]]></category><guid isPermaLink="false">http://www.rickmarkus.com/?p=231</guid> <description><![CDATA[<p>Those new to javascript can start to get a feel for grabbing page elements and adding events by building a simple application.</p><p>The "Click Me" prank is a single button which displays on the page. When the user tries to click the button, the button moves away from the cursor.</p><p>You can view the prank <a href="http://rickmarkus.com/clickme/" title="Click Me Prank" target="_blank">here</a>. Feel free to download the file and use it as you wish.</p><p>Let's start with the markup and styling: <a href="http://www.rickmarkus.com/blog/javascript-click-me-prank-beginners/">...</a></p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/javascript-click-me-prank-beginners/">JavaScript &#8216;Click Me&#8217; prank for beginners</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Those new to javaScript can start to get a feel for grabbing page elements and adding events by building a simple application.</p><p>The &#8220;Click Me&#8221; prank is a single button which displays on the page. When the user tries to click the button, the button moves away from the cursor.</p><p>You can view the prank <a href="http://rickmarkus.com/clickme/" title="Click Me Prank" target="_blank">here</a>. Feel free to download the file and use it as you wish.</p><p>Let&#8217;s start with the markup and styling:</p><pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;title&gt;&lt;/title&gt;
	&lt;meta charset=&quot;utf-8&quot;&gt;

	&lt;style&gt;

	#button {
		width:100px;
		height:50px;
		position:absolute;
		top:100px;
		left:100px;
	}

	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

	&lt;button id=&quot;button&quot;&gt;Click Me!&lt;/button&gt;

&lt;script&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre><p><span id="more-231"></span>The above code creates a basic HTML page, ads a Click Me! button and applies some CSS styling.</p><p>Now on to the javaScript. You will put the following code between the &lt;script&gt; tags.</p><pre class="brush: jscript; title: ; notranslate">var button = document.getElementById(&quot;button&quot;);</pre><p>First, grab the button by its ID using document.getElementByID. Then assign the button element to a variable named button.</p><pre class="brush: jscript; title: ; notranslate">var buttonWidth = button.offsetWidth;
var buttonHeight = button.offsetHeight;</pre><p>Next, grab the width and height of the button element using offsetWidth and offsetHeight. Set those to new variables.</p><pre class="brush: jscript; title: ; notranslate">var browserWidth = window.innerWidth || document.documentElement.clientWidth;
var browserHeight = window.innerHeight || document.documentElement.clientHeight;</pre><p>Next you need to determine the width and height of the user&#8217;s browser window. You will use the information later to randomly position the button around the page.</p><p>You start by creating a variable for both the height and width. Then grab the width of the browser window by using window.innerWidth. Because older &#8220;legacy&#8221; browsers such as IE8 do not support innerWidth, you also have to add an OR operator and use document.documentElement.clientWidth. Repeat the steps for height.</p><p>The width and height variables will be set to a number.</p><pre class="brush: jscript; title: ; notranslate">function move() {
		button.style.left = Math.floor(Math.random()*(browserWidth-buttonWidth)) + &quot;px&quot;;
		button.style.top = Math.floor(Math.random()*(browserHeight-buttonHeight)) + &quot;px&quot;;
	}</pre><p>Next, create the function that will move the button around the page.</p><p>Using Math.random(), generate a random number between 0 and 1. Then multiply that number by the width of the window (stored in the browserWidth variable). For example, if the width of the browser was 800, Math.random() may generate a value of .04328 which would multiply to 34.624. Subtract the width and height of the button from the browser measurements to be sure it never get&#8217;s positioned off the right or bottom sides of the browser window.</p><p>Math.floor is used to remove the decimals from our product, which would result in 34. Concat &#8220;px&#8221; to the end to convert the number into a string (&#8220;34px&#8221;) and set it equal to the button&#8217;s left or top properties.</p><pre class="brush: jscript; title: ; notranslate">if(typeof addEventListener !== &quot;undefined&quot;) {
		button.addEventListener(&quot;mouseover&quot;, move, false);
	} else if (typeof attachEvent !== &quot;undefined&quot;) {
		button.attachEvent(&quot;onmouseover&quot;, move);
	} else {
		button.onmousover = move;
	}</pre><p>Finally, add an event to the page which will trigger when the user&#8217;s mouse moves over the button.</p><p>Start by checking if the user&#8217;s browser is modern (standards compliant) by checking if it supports the addEventListener method. If addEventListener does not return undefined, call that method on the button element.</p><p>Use &#8220;mouseover&#8221; as the event type for the first property, followed by our move function as the listener, followed by false for <a href="https://developer.mozilla.org/en/DOM/element.addEventListener" title="addEventListener syntax by Mozilla" target="_blank">useCapture</a>.</p><p>If addEventListener returns undefined, use the attachEvent method which is supported by older browsers. For the type property, change &#8220;mouseover&#8221; to &#8220;onmouseover&#8221;. Also, you may remove the useCapture property.</p><p>Finally, as a safety guard for browsers that don&#8217;t support attachEvent, we use a DOM level 0 event handler. Set button.onmouseover equal to the move function. This last step is likely overkill for this project, but promotes best practices.</p><p>Here is the final code:</p><pre class="brush: jscript; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
	&lt;title&gt;&lt;/title&gt;
	&lt;meta charset=&quot;utf-8&quot;&gt;

	&lt;style&gt;

	#button {
		width:100px;
		height:50px;
		position:absolute;
		top:100px;
		left:100px;
	}

	&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

	&lt;button id=&quot;button&quot;&gt;Click Me!&lt;/button&gt;

&lt;script&gt;
	var button = document.getElementById(&quot;button&quot;);
	var browserWidth = window.innerWidth || document.documentElement.clientWidth;
	var browserHeight = window.innerHeight || document.documentElement.clientHeight;
	var buttonWidth = button.offsetWidth;
	var buttonHeight = button.offsetHeight;

	function move() {
		button.style.left = Math.floor(Math.random()*(browserWidth-buttonWidth)) + &quot;px&quot;;
		button.style.top = Math.floor(Math.random()*(browserHeight-buttonHeight)) + &quot;px&quot;;
	}

	if(typeof addEventListener !== &quot;undefined&quot;) {
		button.addEventListener(&quot;mouseover&quot;, move, false);
	} else if (typeof attachEvent !== &quot;undefined&quot;) {
		button.attachEvent(&quot;onmouseover&quot;, move);
	} else {
		button.onmousover = move;
	}

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/javascript-click-me-prank-beginners/">JavaScript &#8216;Click Me&#8217; prank for beginners</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">231</post-id>	</item> <item><title>Best resources for aspiring Web developers</title><link>http://www.htmowl.com/blog/best-resources-for-aspiring-web-developers/</link> <comments>http://www.htmowl.com/blog/best-resources-for-aspiring-web-developers/#comments</comments> <pubDate>Sat, 12 May 2012 02:33:55 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[recource]]></category><guid isPermaLink="false">http://www.rickmarkus.com/?p=209</guid> <description><![CDATA[<p>Over the past year I have explored a variety of web development education media from traditional classes to books. Each has strengths and weaknesses -- effectiveness will likely boil down to individual preference.</p><p>I thought I'd share two particular resources that I have found highly useful.</p><p><strong><a href="http://net.tutsplus.com/" title="Nettuts+" target="_blank">Nettuts+</a></strong></p><p>Part of a larger collection of educational resources from Envato, Nettus+ offers online tutorials on HTML, CSS, Javascript and PHP, along with a large number of popular libraries like jQuery.</p><p>Additionally, they have full "courses" -- usually a lengthy series of video tutorials -- they offer via a subscription fee.</p><p>When Nettuts+ launched their premium service last year they offered a course titled "<a href="http://tutsplus.com/course/30-days-to-learn-html-and-css/" title="30 Days to Learn HTML and CSS">30 Days to Learn HTML and CSS</a>" for free. That course is still available as a no-cost example.</p><p></p><p>Tutorials are usually instructed by Editor Jeffrey Way, who I find to be an astonishingly knowledgeable and effective educator.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/best-resources-for-aspiring-web-developers/">Best resources for aspiring Web developers</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Over the past year I have explored a variety of web development education media from traditional classes to books. Each has strengths and weaknesses &#8212; effectiveness will likely boil down to individual preference.</p><p>I thought I&#8217;d share two particular resources that I have found highly useful.</p><p><strong><a href="http://net.tutsplus.com/" title="Nettuts+" target="_blank">Nettuts+</a></strong></p><p>Part of a larger collection of educational resources from Envato, Nettus+ offers online tutorials on HTML, CSS, Javascript and PHP, along with a large number of popular libraries like jQuery.</p><p>Additionally, they have full &#8220;courses&#8221; &#8212; usually a lengthy series of video tutorials &#8212; they offer via a subscription fee.</p><p>When Nettuts+ launched their premium service last year they offered a course titled &#8220;<a href="http://tutsplus.com/course/30-days-to-learn-html-and-css/" title="30 Days to Learn HTML and CSS">30 Days to Learn HTML and CSS</a>&#8221; for free. That course is still available as a no-cost example.</p><p><span id="more-209"></span></p><p>Tutorials are usually instructed by Editor Jeffrey Way, who I find to be an astonishingly knowledgeable and effective educator.</p><p>Envato also offers <a href="http://wp.tutsplus.com/" title="Wptuts+" target="_blank">Wptuts+</a> for WordPress developers and <a href="http://webdesign.tutsplus.com/" title="Webdesigntuts+" target="_blank">Webdesigntuts+</a> for those on the design side. Many more tutorial collections are available at the <a href="http://hub.tutsplus.com/" title="Tuts+ Hub" target="_blank">Tuts+ Hub</a>.</p><p><strong><a href="http://www.codecademy.com/" title="Codecademy" target="_blank">CodeCademy</a></strong></p><p>Those that prefer hands-on coding should be sure to check out Codecademy.</p><p>The resource focused solely on javascript at launch, but has since expanded into HTML and CSS.</p><p>Instead of articles or video tutorials, Codecademy offers live problems the user must correctly solve to advance. The site is careful to introduce users slowly as to not scare away those brand new to coding languages. Those who begin the javascript track, for example, receive the following as their first question:</p><blockquote><p>Hey! Let&#8217;s get to know each other. What&#8217;s your name?</p><p>Type it with quotes around it like this &#8220;Ryan&#8221; and then press enter on your keyboard.</p></blockquote><p>Users of the site are rewarded for correct answers with points and badges. There are more than 500 excercises in the javascript track alone.</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/best-resources-for-aspiring-web-developers/">Best resources for aspiring Web developers</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <wfw:commentRss>http://www.htmowl.com/blog/best-resources-for-aspiring-web-developers/feed/</wfw:commentRss> <slash:comments>1</slash:comments> <post-id xmlns="com-wordpress:feed-additions:1">209</post-id>	</item> <item><title>How to use JavaScript in WordPress pages, posts</title><link>http://www.htmowl.com/blog/how-to-use-javascript-in-wordpress-pages-posts/</link> <pubDate>Wed, 14 Dec 2011 23:30:44 +0000</pubDate> <dc:creator><![CDATA[Rick Markus]]></dc:creator> <category><![CDATA[Blog]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://webwell.org/?p=39</guid> <description><![CDATA[<p>Because WordPress tries to clean up raw code entered on pages or posts under default settings, it will take your JavaScript code and break it. Therefore, the first thing you have to do is make sure those "features" are disabled:</p><ul><li>In your dashboard go to Users, choose your profile and then check "Disable the visual editor when writing."</li></ul><p>Next, you have to install a plugin that lets you choose to keep your page in it's raw code form. I chose <a href="http://plugins.trac.wordpress.org/wiki/TextControl" title="Text Control plugin" target="_blank">Text Control</a>, as recommended in the WordPress codex. Note: There seems to be a newer version (2.3) if you choose to install the plugin from inside the WP dashboard, but I couldn't get it to work properly.</p><ul><li>Install Text Control.</li><li>Go to the page you want to include JavaScript on and make sure there's a saved version/draft. The plugin options may not appear in the backend of the individual page until there is a saved version.</li><li>From Text Control's two drop-down menus, choose "No Formatting" and "No Character Encoding".</li></ul><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/how-to-use-javascript-in-wordpress-pages-posts/">How to use JavaScript in WordPress pages, posts</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></description> <content:encoded><![CDATA[<p>Because WordPress tries to clean up raw code entered on pages or posts under default settings, it will take your JavaScript code and break it. Therefore, the first thing you have to do is make sure those &#8220;features&#8221; are disabled:</p><ul><li>In your dashboard go to Users, choose your profile and then check &#8220;Disable the visual editor when writing.&#8221;</li></ul><p>Next, you have to install a plugin that lets you choose to keep your page in it&#8217;s raw code form. I chose <a href="http://plugins.trac.wordpress.org/wiki/TextControl" title="Text Control plugin" target="_blank">Text Control</a>, as recommended in the WordPress codex. Note: There seems to be a newer version (2.3) if you choose to install the plugin from inside the WP dashboard, but I couldn&#8217;t get it to work properly.</p><ul><li>Install Text Control.</li><li>Go to the page you want to include JavaScript on and make sure there&#8217;s a saved version/draft. The plugin options may not appear in the backend of the individual page until there is a saved version.</li><li>From Text Control&#8217;s two drop-down menus, choose &#8220;No Formatting&#8221; and &#8220;No Character Encoding&#8221;. <span id="more-39"></span></li></ul><p>Next you have to create a JavaScript file and upload it to your server. Put all of the JavaScript defining code in that file. All functions and variable creations go in in there.</p><p>So for instance, if you have the following code:</p><pre>&lt;script type="text/javascript" charset="utf-8"&gt;

	function myFunc() {
	sum = 5 + 10;
	return sum;

	}

	myFunc();

&lt;/script&gt;</pre><p>You would put this in a .js file:</p><pre>	function myFunc() {
	sum = 5 + 10;
	return sum;

	}</pre><ul><li>Upload your JavaScript code to the server. I put mine in a folder called &#8220;scripts&#8221;.</li><li>Finally, call to your javascript to run from inside your WordPress page.</li></ul><p>Following the above example, we would post the following code into the WordPress page we want to run the JavaScript:</p><pre>&lt;script type="text/javascript" src="http://www.yourdomain.com/scripts/yourjavascriptfile.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
&lt;!--
myFunc();
//--&gt;&lt;/script&gt;&lt;/pre&gt;</pre><p>&#8220;myfunc();&#8221; is the call to action that fires up your JavaScript code from the .js file.</p><p>That should do it!</p><p>The post <a rel="nofollow" href="http://www.htmowl.com/blog/how-to-use-javascript-in-wordpress-pages-posts/">How to use JavaScript in WordPress pages, posts</a> appeared first on <a rel="nofollow" href="http://www.htmowl.com">htmOwl | Web Development, Chicago</a>.</p> ]]></content:encoded> <post-id xmlns="com-wordpress:feed-additions:1">39</post-id>	</item> </channel> </rss>