jquery

テーブルにマウスオーバーして図をだす

テーブルにマウスオーバーして図をだす 上の階層の行の行番号を検索 その行の下にぶち抜きの行をつくる ぶちぬくに図を挿入 マウスアウトしたらそれらの行を消す.ソースへの要求 <div id="cor_table"></div> の間にtableをいれる. tableの各行には<a class="fig" href="xxx.png"> みたいな感じにリンクとクラス付の</a>…

JqplotでCanvasの下に重なり触れなくなってしまった要素を触れるようにする。

グラフ描画後以下のスクリプトを実行ポイント (1)再描画ごとに新しく書き直すためpostDrawHooksを利用 (2)点(div class=jqplot-point-label)がソース上canvasの上側にあるのが問題なので、 下に移動する. (3)クラス名でグラフを管理している場合…

親要素のclass属性を取得

親要素のIDを取得 parentで親の要素全体を取得してattr("class")でclass属性を取得する. $(this).parent だけだとhtmlがかえってきてだめなのがポイント. $('div[class2^="pp"]').on('click','canvas', function(){ alert($(this).parent().attr("class")…

.on の使い方(新しい要素にイベントを関連付ける)

.on の使い方(新しい要素にイベントを関連付ける) https://app.codegrid.net/entry/practical-jquery-1 を参照.JQUERYでは存在しない要素にはイベントをつけられない. そこで.onを使ってあとからつけた要素にもイベントを発生させられるようにする. 「…

マウスオーバーしたら図をだす

ParentsUntil文で行にいき、その後ろにdivダグを挿入し, divダグのに中身を図をいれる.表にマウスオーバーしたらリンク先の図をだ $(".fig").hover( function(){ link1=$(this).attr("href"); $(this).parentsUntil("tr").after('<div id="tmp1"></div>'); $("#tmp1").append('<img src="'+link1+'" width="100%" height="100%" />'…

jqueryでデータベース連携

スイッチをおしたらほかのページの情報を出力する 基本 <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>tryjquery_hide_p test</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("input#update"…</meta></head></html>

jqueryでopenコマンドの非同期処理を扱うまとめ

(1) 関数にする.function f(){} (2)関数内にDeferredクラスを導入,function f(){d=$.Deferred} (3)処理が済んだらd.resolve()をよぶ function f(){d=$.Deferred;処理;d.resolve;} (4)d.promise()をリターン function f(){d=$.Deferred;処理;d.r…

javascriptでマウスオーバーしたら他のページをツールチップ風に表示

javascriptでマウスオーバーしたら他のページをツールチップ風に表示 メインページ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"> <script> $(document).ready(function(){ $("p.test2").hover( function(){ //alert("test"); $(this).append('<div id="tmp"><iframe src="in1.html"></iframe></div>

jqplotでつかったグラフの横にマウスオーバーしたら画像を表示

class1 class2 class3 を使って無理やりに. 親要素のclass3を取得して,そこに書き出す. <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>tryjquery_hide_p test</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> </meta></head></html>

表に小さいグラフを埋め込む

表にグラフを取り入れる.http://omnipotent.net/jquery.sparkline/#s-docs のサンプルを参考に、基本を学ぶ. ./jsに jquery.sparkline.js とjquery-2.1.1.jsを保存したあと <head> <script type="text/javascript" src="jquery-2.1.1.js"></script> </head>