<?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>Modernizr &#8211; My Shitty Code</title>
	<atom:link href="https://myshittycode.com/tag/modernizr/feed/" rel="self" type="application/rss+xml" />
	<link>https://myshittycode.com</link>
	<description>Embracing the Messiness in Search of Epic Solutions</description>
	<lastBuildDate>Fri, 06 Jan 2023 17:11:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://myshittycode.com/wp-content/uploads/2022/04/cropped-icon-32x32.png</url>
	<title>Modernizr &#8211; My Shitty Code</title>
	<link>https://myshittycode.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">205304208</site>	<item>
		<title>Modernizr: Detecting Touch Devices vs Non Touch Devices</title>
		<link>https://myshittycode.com/2013/12/30/modernizr-detecting-touch-devices-vs-non-touch-devices/</link>
					<comments>https://myshittycode.com/2013/12/30/modernizr-detecting-touch-devices-vs-non-touch-devices/#respond</comments>
		
		<dc:creator><![CDATA[Shitty Author]]></dc:creator>
		<pubDate>Mon, 30 Dec 2013 20:14:56 +0000</pubDate>
				<category><![CDATA[Programming Language]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Modernizr]]></category>
		<guid isPermaLink="false">http://myshittycode.com/?p=290</guid>

					<description><![CDATA[<p>Modernizr has a great feature that allows us to detect whether the browser is running on a touch device (iPad, smartphones, etc) or on a non-touch device (laptop, computer, etc). Even though most modern touch devices support &#8220;proximity&#8221; hovering (navigating without touching the device screen), the browsing experience still suffer when dealing with onmouseover and [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2013/12/30/modernizr-detecting-touch-devices-vs-non-touch-devices/">Modernizr: Detecting Touch Devices vs Non Touch Devices</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><a href="http://modernizr.com/" target="_blank" rel="noopener">Modernizr</a> has a great feature that allows us to detect whether the browser is running on a touch device (iPad, smartphones, etc) or on a non-touch device (laptop, computer, etc).</p>



<p class="wp-block-paragraph">Even though most modern touch devices support &#8220;proximity&#8221; hovering (navigating without touching the device screen), the browsing experience still suffer when dealing with <code>onmouseover</code> and <code>onmouseout</code> events.</p>



<p class="wp-block-paragraph">So, let&#8217;s assume we want to implement WordPress&#8217; Posts table. When we hover over any table row on a non-touch device, it will show additional actions such as &#8220;Edit&#8221;, &#8220;Quick Edit&#8221;, &#8220;Trash&#8221; and &#8220;View&#8221;. When we view the same page on a touch device, it will show the action without the hovering option.</p>



<p class="wp-block-paragraph">The table may look something like this:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: xml; title: ; notranslate">
&lt;table class=&quot;table-actionable&quot;&gt;
    &lt;tr&gt;
        &lt;th&gt;Artist&lt;/th&gt;
        &lt;th&gt;Song Title&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;System Of a Down&lt;/td&gt;
        &lt;td&gt;Toxicity
            &lt;ul class=&quot;hidden-action hide&quot;&gt;
                &lt;li&gt;&lt;a href=&quot;/epic-app/buy/1&quot;&gt;Buy&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;/epic-app/sell/1&quot;&gt;Sell&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;/epic-app/trash/1&quot;&gt;Trash&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Eminem&lt;/td&gt;
        &lt;td&gt;Rap God
            &lt;ul class=&quot;hidden-action hide&quot;&gt;
                &lt;li&gt;&lt;a href=&quot;/epic-app/buy/2&quot;&gt;Buy&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;/epic-app/sell/2&quot;&gt;Sell&lt;/a&gt;&lt;/li&gt;
                &lt;li&gt;&lt;a href=&quot;/epic-app/trash/2&quot;&gt;Trash&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</pre></div>


<p class="wp-block-paragraph">With Modernizr, we can now write something like this:-</p>


<div class="wp-block-syntaxhighlighter-code "><pre class="brush: jscript; title: ; notranslate">
&lt;script&gt;
    // On non-touch devices, show action list on mouse over and hide it on mouse out.
    if ( !Modernizr.touch ) {
        $( &#039;.table-actionable tr&#039; )
                .mouseover( function () {
                                $( this ).find( &#039;.hidden-action&#039; ).removeClass( &#039;hide&#039; );
                            } )
                .mouseout( function () {
                               $( this ).find( &#039;.hidden-action&#039; ).addClass( &#039;hide&#039; );
                           } );
    }
    // On touch devices, always show action list.
    else {
        $( &#039;.hidden-action&#039; ).removeClass( &#039;hide&#039; );
    }
&lt;/script&gt;
</pre></div>


<p class="wp-block-paragraph">Shitty epic&#8230;</p>
<p>The post <a rel="nofollow" href="https://myshittycode.com/2013/12/30/modernizr-detecting-touch-devices-vs-non-touch-devices/">Modernizr: Detecting Touch Devices vs Non Touch Devices</a> appeared first on <a rel="nofollow" href="https://myshittycode.com">My Shitty Code</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://myshittycode.com/2013/12/30/modernizr-detecting-touch-devices-vs-non-touch-devices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">290</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 49/64 queries in 0.028 seconds using Disk

Served from: myshittycode.com @ 2026-07-17 19:11:39 by W3 Total Cache
-->