call adjustSkillCardsHeight after page is loaded
This commit is contained in:
parent
5d9536a2fd
commit
0ae75b7845
1 changed files with 9 additions and 7 deletions
|
@ -69,20 +69,22 @@ var projectCards;
|
||||||
// primary skills
|
// primary skills
|
||||||
var skillCards = document.getElementById("primary-skills");
|
var skillCards = document.getElementById("primary-skills");
|
||||||
if (skillCards != null) {
|
if (skillCards != null) {
|
||||||
var el = skillCards.children;
|
var cardElems = skillCards.getElementsByClassName("card");
|
||||||
var maxHeight = 0;
|
var maxHeight = 0;
|
||||||
for (let i = 0; i < el.length; i++) {
|
for (let i = 0; i < cardElems.length; i++) {
|
||||||
if (el[i].children[0].clientHeight > maxHeight) {
|
if (cardElems.item(i).clientHeight > maxHeight) {
|
||||||
maxHeight = el[i].children[0].clientHeight;
|
maxHeight = cardElems.item(i).clientHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let i = 0; i < el.length; i++) {
|
for (let i = 0; i < cardElems.length; i++) {
|
||||||
el[i].children[0].setAttribute("style", "min-height: " + maxHeight + "px;")
|
cardElems.item(i).setAttribute("style", "min-height: " + maxHeight + "px;");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$(window).on("load", function () {
|
||||||
adjustSkillCardsHeight();
|
adjustSkillCardsHeight();
|
||||||
|
});
|
||||||
|
|
||||||
// ================== Project cards =====================
|
// ================== Project cards =====================
|
||||||
// Add click action on project category selector buttons
|
// Add click action on project category selector buttons
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue