Today was uneventful. I only continued my work on a pseudoclone of the eriesd wesbite.
My javascript is currently broken due to my attempts to replicate their sliding banner image just under the header.
function slideImg(direction){
const track = getElementById("slidetrack")
const incoming = document.createElement("img")
if (direction == right){
const newsrc = imgs[1]
incoming.src = newsrc
track.appenchild(incoming)
track.style.transform = "translateX(-100%)"
imgs.push(imgs[0]);
imgs.shift()
}
else{
const newsrc = imgs[-1]
incoming.src = newsrc
track.prepend(incoming)
track.style.transofrm = "translateX(100%)"
imgs
}
}
As you can see, my function is unfinished because I ripped it apart and am rebuilding it.
I also had to restructure my html and here is the restructured form of it:
<div class="slidediv">
<div class="slidetrack">
<img src="images\Soviet_Union_Flag.jpg" alt="FORMOTHERRODINA" class="banner" id="currentimg"></img><img src="" alt="">
</div>
<button onclick=slideImg() class="changeimgbutton" id="changeimgbuttonright"><span class="material-symbols-outlined">arrow_circle_right</span></button>
<button onclick=slideImg(left) class="changeimgbutton" id="changeimgbuttonleft"><span class="material-symbols-outlined">arrow_circle_left</span></button>
</div>
I will probably fix the js next week.
Leave a Reply