網頁設計

2013年2月21日 星期四

jQuery function以參數重複利用


function faq(container, terms, definitions) {
$(container).find(terms).hide().end().find(definitions).click(function() {
$(this).next().slideToggle();
});
};
$(document).ready(function() {
faq('#faq', 'dd', 'dt');
});

資料來源: 派克空間
http://inspire.twgg.org/programming/jquery/item/153-jquery-in-the-end-the-school-or-mootools-a-detailed-comparison-of-the-differences.html#mottos

0 意見 :

張貼留言