$.fn.demo = function(options) {
var defaults = {
opacity: 50,
width: '250px',
height: '100px',
color: 'red'
}
}
次のように、オプションを条件付きで関数に渡す方法はありますか?
$().demo({
opacity: 60,
if (div.length){
width: '350px'
}
height: '100px'
});
状況に応じてさまざまなオプションを渡したい状況を処理するための最良の方法は何でしょうか。ありがとう!