0
가변 요소에 사용하기 위해 코드와 같은 플러그인을 만들려고하지만 장소에 갇혀 있습니다. 나는 성공적으로 내가 플러그인을 호출하고 잘 작동하지만 난 변경하는 방법에 붙어 때 색상을 변경 $ .extend을 사용한 위의 첫 번째 코드에서 현재 코드
(function($){
$.fn.dataTable = function(options){
var settings = $.extend({
color:"red"
}, options);
return this.css({
color:settings.color
});
}
}(jQuery));
$('p').dataTable({
color:"blue"
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<p>hello</p>
참조 변수의 값은 플러그인을 호출하는 동안.
는var settings = $.extend({
showInterval: 10,
color:"red"
}, options);`
$.extend
소요 : 나는 당신이 원하는 생각 변수 showInterval