var options=$.extend({
inside:window, transiton:0, minX:0, minY:0, withScrolling:true, vertical:true, horizontal:true },options); 这段代码应该是设置参数的默认值。请问:
第一行的options和最后一行的options分别是什么意思,
$.extend在这里是起什么作用。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
合并参数
function call_me(options) var default_options = { x: 123, y: 234 } options = $.extend(default_options, options); console.log(options); }当我用这个函数时
callme ({ x: 222 });最终得到的参数为
{ x: 222, y: 234 }