User:Archimedes5000/vector.js: Difference between revisions

From Deceive Inc. Wiki
Jump to navigation Jump to search
(Created page with "→‎Restores search on narrow screens by moving it above navigation: function searchfix(){ var s = document.querySelector("#p-search"); var p = document.querySelector("#right-navigation"); var a = document.querySelector("div.vector-menu-content"); if(window.innerWidth <= 700){ a.prepend(s); }else if(window.innerWidth > 700){ p.append(s); }; }; searchfix(); window.addEventListener("resize", function (){ searchfix(); });")
 
mNo edit summary
Line 1: Line 1:
/*Forces responsive content*/
function mobilefix(){
var m = document.querySelector('meta[name="viewport"]');
m.content = "width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0";
};
mobilefix();
/*Restores search on narrow screens by moving it above navigation*/
/*Restores search on narrow screens by moving it above navigation*/
function searchfix(){
function searchfix(){

Revision as of 11:09, 23 March 2024

/*Forces responsive content*/
function mobilefix(){
	var m = document.querySelector('meta[name="viewport"]');
	m.content = "width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0";
};
mobilefix();

/*Restores search on narrow screens by moving it above navigation*/
function searchfix(){
	var s = document.querySelector("#p-search");
	var p = document.querySelector("#right-navigation");
	var a = document.querySelector("div.vector-menu-content");
	if(window.innerWidth <= 700){
		a.prepend(s);
	}else if(window.innerWidth > 700){
		p.append(s);
	};
};
searchfix();
window.addEventListener("resize", function (){
	searchfix();
});