それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。
") }) jQuery.noConflict()(document).ready(function(){ /**ページャーが気に入らないので修正**/ //やるべきこと // pre・next のいれかえ jQuery('span.pager-next').insertAfter('span.pager-prev') // pre/next に矢印を入れる jQuery('a[rel=next]').text(jQuery('a[rel=next]').text()+"> ") jQuery('a[rel=prev]').text("< "+jQuery('a[rel=prev]').text()) // pre/next をヘッダにもってくる //jQuery(".date.first").css("display","inline-block") jQuery('div.permalink.pager').clone().insertAfter(".date.first") jQuery("header .pager a").css("padding","0px 15px"); //pre/next をAjaxで取得してタイトルを取る。 //取得したタイトルをpre/next のタイトルに jQuery('span.pager-next,span.pager-prev').css("display","inline-block") jQuery('span.pager-next,span.pager-prev').css("width","250px"); jQuery('span.pager-next,span.pager-prev').css("overflow", "hidden"); jQuery('span.pager-next,span.pager-prev').css("white-space", "nowrap"); jQuery('span.pager-next,span.pager-prev').css("text-overflow", "ellipsis"); jQuery("a[rel=next],a[rel=prev]").each(function(idx,e){ var anchor = e jQuery.get(anchor.href,null,function(html){ jQuery(anchor).text() var title = jQuery("
").html(html).find(".entry-title").text().trim() jQuery(anchor).attr("title", title); text = jQuery(anchor).text() text = text.slice(0,10); text = text.replace(/の記事/, "の記事 ["+title+"] "); jQuery(anchor).text(text) }) }); }); })

CSS3アニメーションの終了イベント時にjavaScript(jquery)を実行する

CSS3アニメーション(Transition)で、画面の動きが終了した後,にjQuery を実行する

jQuery.bind でアニメーションの終了イベントを登録する

bind で登録できちゃうんですよ

$("#id_are").bind("webkitTransitionEnd",function(){
  $("#id_are").text("アニメ終了")
});

addEventListerでやりますが、bind / unbind が addEventLister / removeEventLister の代替だから、コレで動いちゃったりする。

CSS3のアニメーションonEnd 的な終了イベントは webkitTransitionEndです。

アニメーションの連鎖をする

$("#id_are").bind("webkitTransitionEnd",function(){
  $("#id_are").unbind("webkitTransitionEnd")
  $("#id_are").bind("webkitTransitionEnd",function(){
     $("#id_are").toggleClass("to2")
  })
});
$("#id_are").toggleClass("t1");

アニメーション(Transition)の終了で、次のイベントを仕込んで,さらにアニメーション(Transition)をさせる。たくさん連鎖するなら (Transition)より animation でキーフレームを指定した方が良いですね。

anination / transition

用語不定で困る。CSS3のアニメーションと言われたとき、transition/animationどちらで実装するか事前によく確認のこと

transition
開始・終了を指定する。一回限り
animation
開始・中間点・終了を指定する。ループ可能


transion と animation の大きな違いは keyframe 有無です。そして用途が全然違う。
CSS3のアニメーションって言うときには transition の事がほとんどなのでアニメーションするならググらずちゃんと本を読むか原典に当たる方がよさそうでした。