„MediaWiki:Common.js” változatai közötti eltérés
Innen: Sanctum2 Wikipédia
Ugrás a navigációhozUgrás a kereséshez
Nincs szerkesztési összefoglaló Címke: Visszaállítva |
Nincs szerkesztési összefoglaló |
||
(32 közbenső módosítás, amit egy másik szerkesztő végzett, nincs mutatva) | |||
1. sor: | 1. sor: | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var footerImage = $('<div id="footer-image"><img src="https://wiki.nw2online.com/skins/monobook/content_foot.png?2017-05-14T14:15:00Z" alt="Footer Image"></div>'); | |||
var | $('#mw-content-text').append(footerImage); | ||
$('# | |||
}); | }); | ||
$(document).ready(function() { | $(document).ready(function() { | ||
var headerImage = $('<div id="header-image"><img src="https://wiki.nw2online.com/skins/monobook/content_head.png?2017-05-14T14:15:00Z" alt="Header Image"></div>'); | |||
var | $('#firstHeading').prepend(headerImage); | ||
}); | |||
// | $(document).ready(function() { | ||
$('#content'). | var sideImage = $('<div id="side-image"><img src="https://wiki.nw2online.com/skins/newimages/character.png" alt="Side Image"></div>'); | ||
$('#mw-content-text').append(sideImage); | |||
}); | |||
// | $(document).ready(function() { | ||
$(' | // Hozzunk létre egy gombot | ||
var backButton = $('<button id="back-button" style="position: fixed; bottom: 10px; right: 10px; z-index: 1000;">Vissza az előző oldalra</button>'); | |||
document.addEventListener("DOMContentLoaded", function() { | |||
// Kép URL-je | |||
var imageUrl = "https://wiki.nw2online.com/skins/monobook/head.png?2017-05-14T14:15:00Z"; | |||
// Kép elem létrehozása és beállítása | |||
var img = new Image(); | |||
img.src = imageUrl; | |||
img.alt = "Top Image"; // Alt attribútum a képleíráshoz | |||
img.style.position = "fixed"; // Fix pozíció a lap tetején | |||
img.style.top = "0"; | |||
img.style.left = "50%"; // Középre igazítás | |||
img.style.transform = "translateX(-50%)"; // Középre igazítás | |||
img.style.zIndex = "1000"; // Biztosítja, hogy a kép a legtetején legyen | |||
img.style.width = "100%"; // Kép szélessége a teljes képernyő szélessége | |||
// Kép hozzáadása a body elemhez | |||
document.body.appendChild(img); | |||
}); | }); | ||
$(document).ready(function() { | // | ||
$(document).ready(function(){ | |||
setDesignCharacter(); | |||
setFooterPosition(); | |||
setSidebarFlow(); | |||
setFootPosition(); | |||
setScrollAnimation(); | |||
}); | }); | ||
$( | $(window).resize(function(){ | ||
setDesignCharacter(); | |||
setSidebarFlow(); | |||
setFootPosition(); | |||
}); | }); | ||
$(document). | $(document).scroll(function(e){ | ||
pageScrollEvent(); | |||
}); | }); | ||
var setDesignCharacter = function() { | |||
var ww = $(window).width(); | |||
var character = $('div#fixed_character_design'); | |||
character.css({ | |||
visibility: ww > 1220 ? 'visible' : 'hidden', | |||
}); | |||
} | |||
var setSidebarFlow = function() { | |||
var wh = $(window).height(); | |||
var sidebar = $('div.sidebar_top, div#p-logo'); | |||
sidebar.css({ | |||
position: wh < 700 ? 'absolute' : 'fixed' | |||
}); | |||
} | |||
var setFootPosition = function() { | |||
var wh = $(window).height(); | |||
var fp = $('div.foot').offset(); | |||
var body = $('div#bodyContent'); | |||
var bp = body.offset(); | |||
$('div#bodyContent').css({ | |||
height: fp.top < (wh - 200) ? (wh - bp.top - 310) : 'auto' | |||
}); | |||
} | |||
var setFooterPosition = function() { | |||
var wh = $(window).height(); | |||
var footer = $('div#footer'); | |||
var fp = footer.offset(); | |||
var fh = footer.height(); | |||
if ((wh-fh) > fp.top) { | |||
footer.css({ | |||
bottom: 0, | |||
width: '100%', | |||
position: 'fixed', | |||
}); | |||
} | |||
footer.css({ | |||
visibility: 'visible', | |||
}); | |||
} | |||
pageScrollBackgroundValue = 0; | |||
pageScrollLastValue = 0; | |||
var pageScrollEvent = function(e){ | |||
var scTop = $(window).scrollTop(); | |||
if (Math.abs(scTop - pageScrollLastValue) > 10) { | |||
var dir = scTop < pageScrollLastValue ? 1 : -1; | |||
pageScrollLastValue = scTop; | |||
pageScrollBackgroundValue += 188 * dir; | |||
$('div#p-cactions div.animation').css({ | |||
backgroundPosition: '0px ' + pageScrollBackgroundValue + 'px' | |||
}); | |||
} | |||
} |
A lap jelenlegi, 2024. június 24., 16:21-kori változata
$(document).ready(function() { var footerImage = $('<div id="footer-image"><img src="https://wiki.nw2online.com/skins/monobook/content_foot.png?2017-05-14T14:15:00Z" alt="Footer Image"></div>'); $('#mw-content-text').append(footerImage); }); $(document).ready(function() { var headerImage = $('<div id="header-image"><img src="https://wiki.nw2online.com/skins/monobook/content_head.png?2017-05-14T14:15:00Z" alt="Header Image"></div>'); $('#firstHeading').prepend(headerImage); }); $(document).ready(function() { var sideImage = $('<div id="side-image"><img src="https://wiki.nw2online.com/skins/newimages/character.png" alt="Side Image"></div>'); $('#mw-content-text').append(sideImage); }); $(document).ready(function() { // Hozzunk létre egy gombot var backButton = $('<button id="back-button" style="position: fixed; bottom: 10px; right: 10px; z-index: 1000;">Vissza az előző oldalra</button>'); document.addEventListener("DOMContentLoaded", function() { // Kép URL-je var imageUrl = "https://wiki.nw2online.com/skins/monobook/head.png?2017-05-14T14:15:00Z"; // Kép elem létrehozása és beállítása var img = new Image(); img.src = imageUrl; img.alt = "Top Image"; // Alt attribútum a képleíráshoz img.style.position = "fixed"; // Fix pozíció a lap tetején img.style.top = "0"; img.style.left = "50%"; // Középre igazítás img.style.transform = "translateX(-50%)"; // Középre igazítás img.style.zIndex = "1000"; // Biztosítja, hogy a kép a legtetején legyen img.style.width = "100%"; // Kép szélessége a teljes képernyő szélessége // Kép hozzáadása a body elemhez document.body.appendChild(img); }); // $(document).ready(function(){ setDesignCharacter(); setFooterPosition(); setSidebarFlow(); setFootPosition(); setScrollAnimation(); }); $(window).resize(function(){ setDesignCharacter(); setSidebarFlow(); setFootPosition(); }); $(document).scroll(function(e){ pageScrollEvent(); }); var setDesignCharacter = function() { var ww = $(window).width(); var character = $('div#fixed_character_design'); character.css({ visibility: ww > 1220 ? 'visible' : 'hidden', }); } var setSidebarFlow = function() { var wh = $(window).height(); var sidebar = $('div.sidebar_top, div#p-logo'); sidebar.css({ position: wh < 700 ? 'absolute' : 'fixed' }); } var setFootPosition = function() { var wh = $(window).height(); var fp = $('div.foot').offset(); var body = $('div#bodyContent'); var bp = body.offset(); $('div#bodyContent').css({ height: fp.top < (wh - 200) ? (wh - bp.top - 310) : 'auto' }); } var setFooterPosition = function() { var wh = $(window).height(); var footer = $('div#footer'); var fp = footer.offset(); var fh = footer.height(); if ((wh-fh) > fp.top) { footer.css({ bottom: 0, width: '100%', position: 'fixed', }); } footer.css({ visibility: 'visible', }); } pageScrollBackgroundValue = 0; pageScrollLastValue = 0; var pageScrollEvent = function(e){ var scTop = $(window).scrollTop(); if (Math.abs(scTop - pageScrollLastValue) > 10) { var dir = scTop < pageScrollLastValue ? 1 : -1; pageScrollLastValue = scTop; pageScrollBackgroundValue += 188 * dir; $('div#p-cactions div.animation').css({ backgroundPosition: '0px ' + pageScrollBackgroundValue + 'px' }); } }