mozilla blue highlight color in clickeable javascript elements -
i have problem mozilla , classic blue highlight color. there's no problem highlighted text, mean, i've been searching , tried ::-moz-selection css property, , works fine, real deal comes clickeable javascript events have on page, example...
css
figure:nth-of-type(1) { -o-transform: translate(60%,-25%) rotate(-10deg) scale(0.60); -webkit-transform: translate(60%,-25%) rotate(-10deg) scale(0.60); -moz-transform: translate(60%,-25%) rotate(-10deg) scale(0.60); transform: translate(60%,-25%) rotate(-10deg) scale(0.60); } figure.active:nth-of-type(1) { z-index:10; box-shadow:0px 0px 50px black; -o-transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); -webkit-transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); -moz-transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); }
javascript
<script type="text/javascript" > <!-- function listen() { var images=document.getelementsbytagname("figure"); var i=images.length; while(i--){images[i].addeventlistener('click', focusimage);} } function heard() { var images=document.getelementsbyclassname("active"); var i=images.length; while(i--){images[i].addeventlistener('click', unfocusimage);} } function focusimage(x){ var target=x.target; var images=document.getelementsbytagname("figure"); var i=images.length; while(i--){images[i].classname=""; images[i].addeventlistener('click', focusimage)} if (target.tagname=="figure"){target.classname='active';} target.removeeventlistener('click', focusimage) heard(); } function unfocusimage(x){ var target=x.target; if (target.classname=="active"){target.classname='';} target.addeventlistener('click', focusimage); } //--> window.addeventlistener('load', listen); </script>
html
<figure> <img src="<?php bloginfo('template_directory'); ?>/assets/art_home/01.jpg" alt="" /> </figure>
so... when click, figure/img becomes blue highlightning (it disappears if click on place)...
i tried css selectors know (::selection, ::-moz-selection, visited, active, etc.), , in chrome don't have problem.
help please!!
this solution should work in non-ie browsers (and ie 10) per post:
prevent text selection after double click
in css:
.no_selection { -webkit-user-select: none; /* webkit (safari, chrome) browsers */ -moz-user-select: none; /* mozilla browsers */ -khtml-user-select: none; /* webkit (konqueror) browsers */ -ms-user-select: none; /* ie10+ */ }
in html:
<figure class="no_selection"> <img src="<?php bloginfo('template_directory'); ?>/assets/art_home/01.jpg" alt="" /> </figure>
Comments
Post a Comment