Logo Albion iconAlbion Online Deadlock iconDeadlock GW2 iconGuild Wars 2 TL iconThrone & Liberty

Difference between revisions of "Common.js"

Line 6: Line 6:
 
});
 
});
  
var coll = document.getElementsByClassName("collapse");
+
var coll = document.getElementsByClassName("collapseMB");
 
var i;
 
var i;
 
for (i = 0; i < coll.length; i++) {
 
for (i = 0; i < coll.length; i++) {

Revision as of 18:34, 3 September 2022

$(function() {
	$(".build-template-button").click(function(){
		navigator.clipboard.writeText($(this).prev().text());
		alert("Template code copied!");
	});
});

var coll = document.getElementsByClassName("collapseMB");
var i;
for (i = 0; i < coll.length; i++) {
	coll[i].addEventListener("click", function() {
		this.classList.toggle("active");
		var content = this.nextElementSibling;
		if (content.style.display === "block") {
			content.style.display = "none";
		} else {
			content.style.display = "block";
		}
	});
}
Get MetaBattle Premium
Enjoy an ad-free experience & support the website, for less than $1 per month! Upgrade to Premium
Split Metabattle Logo