シンプルなjqueryプラグインを開発しようとしています...
jquery のドキュメントを読んで、プラグインを追加した div を変更しようとしていますが、正直なところ、何が起こっているのかわかりません。
これは jfiddle リンクです: http://jsfiddle.net/9eLqm/
html:
<script type="text/javascript">
$(document).ready(function() {
$('dropdown').pifo_dropdown({'width': 300, 'fontsize' : 18 });
$('dropdown').pifo_dropdown('show');
});
</script>
<div id="dropdown"> div</div>
JavaScript:
(function( $ ) { var settings = $.extend( { 'width' : 200, 'maxheight' : 200, 'fontsize' : 13, 'defaultlbl' : 'オプションを選択' });
var メソッド = { init : function( オプション ) {
設定 = $.extend(オプション); // 設定の適用 } };$.fn.pifo_dropdown = function( method, options ) { // Methods if ( methods[method] ) { return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 )); } else if ( typeof method === 'object' || ! method ) { return methods.init.apply( this, arguments ); } else { $.error( 'Method ' + method + ' does not exist on jQuery.pifo_dropdrown' ); } this.fadeOut();
};
}) (jQuery);
誰でも私を助けることができますか?少し早いですがお礼を