2014-12-15 6 views
0

나는 나는 그것의 JS 파일에 내 자신의 방법을 만들고이를gridster.js에 사용자 정의 메소드를 추가하는 방법은 무엇입니까?

스크립트

파일 EG

에 사용할, Gridster 도서관 .IT가 add_widget 같은 그 방법은 Remove_widget는, 크기를 조정 제공 드래그 가능한 등 을 사용하고 있습니다
$(function(){$(".gridster ul").gridster({ 
     widget_margins: [10, 10], 
     widget_base_dimensions: [140, 140], 
     animate: true, 
     Custom_Method:{enable:true} 
    }) 
}).data('gridster'); 

무엇 예와 같은 일부 내 custom_method

답변

0
$(function(){$(".gridster ul").gridster({ 
    widget_margins: [10, 10], 
    widget_base_dimensions: [140, 140], 
    animate: true, 
    customMethod:function(){enable:true} //Your custom method 
}) 

}). 다에 대해 표시됩니다 타 ('그리 스터');

// 액세스하려면

$(".gridster ul").gridster().data('gridster').options.customMethod() 
관련 문제