jQuery
●記述方法
<script>
$(document).ready(function(){
$(“セレクター”).jQueryの命令
});
</script>
⇒$以下は下記に省略可能
$(function(){
~
});
●jQueryでは、CSSでおなじみの様々なセレクターが利用できる。(jQueryデザイン入門p27~)
・要素セレクター ⇒特定のhtml要素(li等)に対して命令を実行する時に利用。「セレクター」のところにhtml要素を記載。
・IDセレクター ⇒id属性の値に#を付けたものをセレクターとして利用。
・クラスセレクター ⇒class属性の値に.を付けたものをセレクターとして利用。
・子孫セレクター
・ユニバーサルセレクター
・グループセレクター
●その他全般
・CDNのスリム版を使うと、slideDonw()などが使えないので要注意。https://rabotiku-sato.com/jquery-slidedown-error
・jQueryプラグイン
$.fn.menumaker = function(options) ~
という書き方は、jQueryオブジェクトにmenumakerというメソッドを追加しますよという宣言です。https://teratail.com/questions/15242
・メソッド: 一覧⇒https://javascript.programmer-reference.com/jquery-list-method/
ready(); HTML構造ができてから処理を実行させる時に使用。https://teratail.com/questions/15242
$(document).ready(function() {
});
若しくは
$(function() {
});
toggleClass:http://cly7796.net/wp/javascript/try-using-toggle-class/
・UI
D&D:https://liginc.co.jp/web/js/jquery/102848
・その他
$(this)の使い方: https://www.flatflag.nir87.com/this-1371
・jQueryプラグイン
$.fn.menumaker = function(options) ~
という書き方は、jQueryオブジェクトにmenumakerというメソッドを追加しますよという宣言です。https://teratail.com/questions/15242
・メソッド: 一覧⇒https://javascript.programmer-reference.com/jquery-list-method/
ready(); HTML構造ができてから処理を実行させる時に使用。https://teratail.com/questions/15242
$(document).ready(function() {
});
若しくは
$(function() {
});
toggleClass:http://cly7796.net/wp/javascript/try-using-toggle-class/
・UI
D&D:https://liginc.co.jp/web/js/jquery/102848
・その他
$(this)の使い方: https://www.flatflag.nir87.com/this-1371
Bootstrap
Bootstrapのcss、3つのjavascript(bootstrap,jQuery,Popper)が必要(cssフレームワークBootstrap入門より)
jQuery等を先に読み込む必要あり。https://qiita.com/ryuji_i3/items/0207a41ce136d6c3aeba
コメントを残す