Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

【JavaScript】スタイルシート

More than 1 year has passed since last update.

javascriptでcss情報を取得する

スクリプト

var element = document.getElementById('box');
var style = (element.currentStyle || document.defaultView.getComputedStyle(element, ''));
style.width;

CSSアニメーション後のイベント

概要

jQueryで
CSSアニメーション終了後に
イベントを発火させたい場合

施策

(function($){
    $.fn.animateCallback = function(callback){
        var alias = "animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd";

        return this.each(function() {
            var ua = navigator.userAgent;

            if(ua.indexOf('MSIE 9')!=-1){
                return callback.call(this);
            }else{
                $(this).bind(alias, function(){
                    $(this).unbind(alias);
                    return callback.call(this);
                });
            }
        });
    };
})(jQuery);

使用方法

$('div').animateCallback(function(){
    //CSSアニメーション終了後の処理
});
hiron712
備忘録です。 間違っていたり、 どこかの引用もあります。 すみません。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away