Created
January 30, 2017 07:53
-
-
Save Restoration/db7e43d4fe90b329dd64084686e99215 to your computer and use it in GitHub Desktop.
setTimeoutで$(this)を渡す方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function($){ | |
$('.trigger').onclick(function(){ | |
function alertFnc($(this)){ | |
alert($(this)); | |
} | |
setTimeout(alertFnc(),300); | |
var target = $(this); | |
setTimeout(function(){ | |
//ここに処理を記述 | |
//$(this)をsetTimeout関数に渡す時は第三引数に渡す | |
},300,target); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment