Difference between revisions of "User:Lexar/Main Page/Template:Benjas/Page.js"

From Team Fortress Wiki
Jump to: navigation, search
(main menus hopefully will work now.)
m
Line 27: Line 27:
 
var th = $(this);
 
var th = $(this);
 
mainMenu.append('<li>');
 
mainMenu.append('<li>');
mainMenu.append('<h3><span>'+th.children('h3').text()+' <img src="b-arrow.png" /></span></h3><ul>');
+
mainMenu.append('<h3><span>'+th.children('h3').text()+' <img src="b-arrow.png" /></span></h3>\
th.children('div ul li').each(function(){
+
<ul>\
 +
<li class="clearing"></li>\
 +
</ul>\
 +
<div class="clearing"></div></li>');
 +
/*th.find('div ul li').each(function(){
 
var thi = $(this);
 
var thi = $(this);
 
mainMenu.append('<li>'+thi.html()+'</li>');
 
mainMenu.append('<li>'+thi.html()+'</li>');
});
+
});*/
mainMenu.append('<li class="clearing"></li></ul><div class="clearing"></div></li>');
 
 
});
 
});

Revision as of 12:41, 2 November 2014

$('head').prepend('<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>');
$('#mw-content-text').addClass('main-area');

var mobileMenu = $('#mobile-menu'), mobileMenuButton = $('#mobile-menu .mobile-menu-button'), pageMenu = $('#mobile-menu #page-menu'),
accountMenu = $('#mobile-menu #account-menu'), accountList = $('#mobile-menu #account-list'), pageList = $('#mobile-menu #tab-menu'),
menuSearch = $('#mobile-menu #p-search'), openSearch = $('#mobile-menu #search-expand'), mainMenu = $('#mobile-menu #mobile-ul-main');

$('#mw-head #p-personal > ul > li').each(function(){
	var th = $(this);
	accountList.append('<li><span>' + th.html() + '</span></li>');
});
$('#left-navigation ul li').each(function(){
	var th = $(this);
	pageList.append('<li>'+th.html()+'</li>');
});
$($('#right-navigation #p-cactions .menu ul li').get().reverse()).each(function(){
	var th = $(this);
	pageList.append('<li class="f-right">'+th.html()+'</li>');
});
$($('#right-navigation #p-views ul li').get().reverse()).each(function(){
	var th = $(this);
	pageList.append('<li class="f-right">'+th.html()+'</li>');
});
$('#right-navigation #p-search #searchform').clone().appendTo(menuSearch);

$('#mw-panel .portal').each(function(){
	var th = $(this);
	mainMenu.append('<li>');
	mainMenu.append('<h3><span>'+th.children('h3').text()+' <img src="b-arrow.png" /></span></h3>\
	<ul>\
	<li class="clearing"></li>\
	</ul>\
	<div class="clearing"></div></li>');
	/*th.find('div ul li').each(function(){
		var thi = $(this);
		mainMenu.append('<li>'+thi.html()+'</li>');
	});*/
});