&tag(jQuery);
*目次 [#e840b8da]
#contents
*参考情報 [#w6217b0a]
-[[jQuery:http://jquery.com/]]

*インストール [#j825d585]
-http://code.jquery.com/jquery-1.9.1.min.js をダウンロード。


*Tips [#ob2a5daf]
**テキストを選択する [#u7299ab2]
-[[select - JQuery: Selecting Text in an Element (akin to highlighting with your mouse) - Stack Overflow:http://stackoverflow.com/questions/985272/jquery-selecting-text-in-an-element-akin-to-highlighting-with-your-mouse]]
-[[JavaScript初級者から中級者になろう:八章第一回 Rangeとは:http://uhyohyohyo.sakura.ne.jp/javascript/8_1.html]]
-ノード単位の選択はできるけど、中途半端な選択はできない。

*指定要素にスクロールさせる [#cde4cfd5]
-ScrollTo('keyword')のように指定する(id=keyword)。
#pre{{
    function ScrollTo(element) {
        var text = document.getElementById(element);
        var p = $(text).offset().top;
        $('html,body').animate({ scrollTop: p });
  }
}}
-html,bodyを指定しているのは、クロスブラウザ対応のためだけど、副作用があるみたいなので注意。
[[jQueryで画面をスクロールさせる時の注意点:http://less.carbonfairy.org/post/941824993]]
*トラブルシューティング [#l1c56633]
**なぜか読み込まれない [#se778fb5]
-jQueryに限ったことではないが、空タグっぽい書き方だとだめ。"</script>"が必要。
-[[scriptタグは空要素っぽく閉じると,FirefoxやIEで読んでもらえない ::ハブろぐ:http://havelog.ayumusato.com/develop/html/e216-script_tag_should_not_self-close.html]]

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS