MediaWiki:Mobile.js
於 2019年6月8日 (六) 04:30 由 Zetetic(留言 | 貢獻) 所做的修訂 (已建立頁面,內容為 "→此處的JavaScript將載入於使用手機版的使用者: //Removes the current mfTempOpenSection function so we don't get console errors on heading clicks $…")
注意:在您發布之後,您可能需要清除瀏覽器快取才能看到變更。
- Firefox或Safari:按住Shift時點擊重新整理,或按Ctrl-F5或Ctrl-R(Mac則為⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac則為⌘-Shift-R)
- Internet Explorer或Edge:按住Ctrl時點擊重新整理,或按Ctrl-F5
- Opera:按Ctrl-F5。
/* 此處的JavaScript將載入於使用手機版的使用者 */
//Removes the current mfTempOpenSection function so we don't get console errors on heading clicks
$('.section-heading').prop('onclick',null);
//Add a new function that changes the display parameter of the collapsible div associated to the clicked header
$('.section-heading').click(function($event){
var source = $event.target;
var sectionHeadings = $('.section-heading');
sectionHeadings.toArray().forEach(function(section){
var span = section.getElementsByTagName('span')[0];
if (span.id == source.id){
var collapseDiv = section.nextSibling;
collapseDiv.style.display = collapseDiv.style.display == "block" ? "none" : "block";
return;
}
});
});