MediaWiki:Common.js:修订间差异
跳到导航
跳到搜索
无编辑摘要 |
无编辑摘要 |
||
第6行: | 第6行: | ||
//shulan_desu 用于侧边栏的控制 | //shulan_desu 用于侧边栏的控制 | ||
$(function() { | $(function() { | ||
var Accordion = function(el, multiple) { | var Accordion = function(el, multiple) { | ||
第34行: | 第33行: | ||
var accordion = new Accordion($('#mw-panel'), false); | var accordion = new Accordion($('#mw-panel'), false); | ||
}); | }); |
2016年7月12日 (二) 09:43的版本
function animate() {
}
animate();
//shulan_desu 用于侧边栏的控制
$(function() {
var Accordion = function(el, multiple) {
this.el = el || {};
this.multiple = multiple || false;
// Variables privadas
var links = this.el.find('.portal h3');
// Evento
links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown);
// OP
links.click();
};
Accordion.prototype.dropdown = function(e) {
var $el = e.data.el;
$this = $(this),
$next = $this.next();
$next.slideToggle();
$this.parent().toggleClass('open');
if (!e.data.multiple) {
$el.find('#mw-panel .portal h3 .body ul').not($next).slideUp().parent().removeClass('open');
}
};
var accordion = new Accordion($('#mw-panel'), false);
});