うまくいけば、私はこれを正しく表現しています...
jquery関数のオプションとして要素IDを渡そうとしています:
$('.carousel').createcarousel({
theid: $(this).attr('id'), // this is the part I am trying to get working
delay: 150,
fade:300,
slide: 700,
effect:'slide',
orientation:'horizontal',
loop: false,
autoplay: false });
関数自体の中で、オプションは として定義されているo
ので、次のようなことができます:
alert(o.fade);
そして、「300」を示すアラートが表示されます。しかし、もしそうなら:
alert(o.theid);
未定義と書いてあります。なんで?