<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ofsilvers</author_name>
  <author_url>https://blog.hatena.ne.jp/ofsilvers/</author_url>
  <blog_title>しるてく</blog_title>
  <blog_url>https://ofsilvers.hateblo.jp/</blog_url>
  <categories>
    <anon>javascript</anon>
  </categories>
  <description>スマホで :hover を使うと、タップを話した後も色が変わったままだったりしてしまうので、class名をあてて擬似的にhoverを実装する必要があるようだ。 jQueryを使う場合 $( 'a' ).bind('touchstart', function(){ $(this).addClass( 'hover' ); }).bind('touchend', function(){ $(this).removeClass( 'hover' ); }); jQueryを使わない場合 var pseudoHover = function() { var elm = document.getElem…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fofsilvers.hateblo.jp%2Fentry%2Fjs-pseudo-hover&quot; title=&quot;スマホで擬似的にhoverを実装する - しるてく&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-08-07 08:00:26</published>
  <title>スマホで擬似的にhoverを実装する</title>
  <type>rich</type>
  <url>https://ofsilvers.hateblo.jp/entry/js-pseudo-hover</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
