私はしばらくの間これを理解しようとしていましたが、今はここに投稿して、setInterval
私が抱えているこの問題を最終的に理解できるかどうかを確認しようと思いました。
これが問題になる場合は、このドキュメントでjQuery1.4.4を使用しています。
次の場合:
var MS = {},
MS.timer = 1200; // this both would be user accessible by the plugin
// if the timer option is set then activate slideshow
if ( MS.timer ) { setInterval( "go(2,'right')" , MS.timer); }
// show the slide (as defined by the pass ins)
function go(slideNumber, direction) {
if ( !paused || !running ) {
console.log('run!'+', '+slideNumber+' , '+direction);
}
}
ただし、これにより次のようになります。
go is not defined
これは、1200ミリ秒ごとに「正しく」ログに記録されます。go()
では、の値を渡すなど、関数を実行するにはどうすればよいですslideNumber, direction
か?