GithubHelp home page GithubHelp logo

jquery.modal's People

Contributors

jungissei avatar

Watchers

 avatar  avatar

jquery.modal's Issues

ハンバーガーメニュー / アクセシビリティを高める

https://baigie.me/engineerblog/?p=234

  • メニューボタンはbutton要素で実装し、WAI-ARIA属性を付ける。
  • メニューの開閉状態がスクリーンリーダーに伝わる。
  • 各要素にフォーカスがあたり、キーボードで操作が可能。
  • メニューが閉じている状態ではメニュー項目にフォーカスが当たらないようにする。
  • アコーディオンメニューがある場合、メニューが閉じている状態でアコーディオンメニューの中身にフォーカスが当たらないようにする。
  • エスケープキーでメニューを閉じられるようにする。
  • メニューを閉じた際にメニューボタンにフォーカスが戻るようにする。
  • キーボード操作時、メニューの最後の項目までいったらメニューボタンもしくはメニューの先頭にフォーカスが戻るようにする。

https://docs.google.com/presentation/d/1Gcny5O0jrFbRVfjJWTiRfFkk3EMCLwiS-kqwj_JTCUM/htmlpresent

  • メニューだと伝わる
  • ポップアップするウィジェットだと伝わる
  • 起動ボタンとメニュー内容が紐付いている
  • メニューがページ内のどこにあるのかすぐわかる

demo2として、ハンバーガーメニューを開いた時の遅延アニメーション作成

/**
 * ハンバーグメニュー内のanimation-delay追加
 * @param {string} animation_item アニメーションアイテム
 */
function add_humburger_inner_menu_animation_delay(animation_item) {
  let cur_deley = 0,
      increment_deley = 0.05;

  $(animation_item).each(function(){
    $(this).css('transition-delay', cur_deley + 's');
    cur_deley = get_humburger_inner_menu_animation_delay(cur_deley, increment_deley);
  });
}

/**
 * animation-delay追加
 * @param {int} cur_deley 現在の遅延秒数
 * @param {int} increment_deley 遅延秒数
 */
function get_humburger_inner_menu_animation_delay(cur_deley, increment_deley) {
  return cur_deley + increment_deley;
}


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.