10,947
editsMore actions
no edit summary
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
'<video src="https://bg3.wiki/w/resources/assets/banner.webm" style="max-width:100%" autoplay="" loop="" muted="" playsinline="1" width="100%" height="auto"></video>'; | '<video src="https://bg3.wiki/w/resources/assets/banner.webm" style="max-width:100%" autoplay="" loop="" muted="" playsinline="1" width="100%" height="auto"></video>'; | ||
} | } | ||
$(document).ready(function () { | |||
var body = document.getElementsByTagName("body")[0]; | |||
var callback = function(mutList, _obs) { | |||
var mut = mutList[0]; | |||
var mutNode = mut.addedNodes; | |||
if (mutNode.length !== 0 && mutNode[0].classList.contains("mwe-popups")) { | |||
var eleLeft = mutNode[0].style.left; | |||
var marginLeft = window.getComputedStyle(body).getPropertyValue("margin-left"); | |||
// subtract the left margin from the computed value | |||
mutNode[0].style.left = "calc("+ eleLeft + " - "+ marginLeft + ")"; | |||
} | |||
}; | |||
var observer = new MutationObserver(callback); | |||
observer.observe(body, { childList: true }); | |||
}); |