私はこのカスタムレイアウトを構築しています。Firefoxでは奇妙なことが起こっています。Firefoxでの.focusに関する問題
ご覧のとおり、タブまたはマウスでFirefoxをクリックすると、画像にフォーカスが当てられません。これはChromeで正常に動作します。彼らは画像でなければなりません。なぜなら、最終的な製品はsvgsであり、クリック可能でキーボードにアクセス可能でなければならないからです。
そして、ここでは
if (jQuery(window).width() > 900) {
//Execute only when width is greater than 900px
var circles = document.getElementsByClassName("js-circle"),
text = document.getElementsByClassName("js-text"),
buttons = document.getElementsByClassName("js-button");
for (var i = 0; i < circles.length; i++) {
console.log("assign listeners");
assignListeners(i);
}
function assignListeners(i) {
(function(i) {
circles[i].addEventListener('focus', function(e) {
console.log(circles[i]);
reveal(e, i);
}, false);
buttons[i].addEventListener('blur', function(e) {
hide(e, i);
}, false);
}(i));
}
function reveal(e, i) {
jQuery(text[i]).fadeIn();
}
function hide(e, i) {
jQuery(text[i]).fadeOut();
}
}
Firefoxはフォーカスセレクタを無視するので、これは機能しません。 –
@KathrynCrawford:tabindexのないフォーカスセレクタが機能しません(リンクまたはフォーム要素のみ)。スニペットはFFで動作します。それがうまくいかない例がありますか?スニペットの横にFirefoxを作って作った(私は:focusとtabindexを数年間演奏した)? –
@ KathrynCrawford http://dabblet.com/gist/2906473 tabindexと:focus(no js)による実験的な2レベルのメニュー。FF&ほぼ5年前に作られました...クリックまたはタブキーで動作します –