jQuery 複数の要素に処理を
2009年07月13日(月)
JQueryで複数要素のセレクタに
各々処理を行うときはeachが便利です。
今回もまたパラメータの違うFlashを複数埋め込む場合に利用しました。
$(function(){
var selector=$(".graph-area");
selector.each(function(){
var id=$(this).attr("id");//IDを取得
var graphdata=$(this).text();//テキストを取得
addListSwf(id,graphdata,"50");//テキストをパラメータとしてswfobjectでFlash埋め込み
});
function addListSwf(idname,param){
var att = { data:"img/graph.swf", width:"160", height:"160" };
var par={ menu:"false",flashvars:param};
var id = idname;
var mainFlash = swfobject.createSWF(att, par, id);
};
});
関連記事
- jQuery 複数の要素に処理を
- swfobjectのあるある
- jQuery プラグイン修正版
- jQuery はじめてのjQueryプラグイン(駄作)
- swfobject2 第2回
- jQuery チェックボックスのチェック・解除
- jQuery スライドショーでフェードイン、フェードアウト2010
- jQuery liveがすごい便利
- jQuery aのイベントでリンクさせない処理
- jQuery フェードイン完了を待つ
- jQueryによる、属性変更
- SWFObjectをgoogleから
- AS3 TweenerのsetTimeScaleを試すつもりが
- PHP メールアドレスの書式チェック
- jQuery submitでconfirm