function stopTimer() {
// wait 2 seconds before calling goInactive this changes speed of slideshow
timeoutID = window.clearInterval(goToStartItem, 1);
//setTimeout(goToNextItem, 2000);
}
tried to add this function and call it
function stopTimer() {
// wait 2 seconds before calling goInactive this changes speed of slideshow
timeoutID = window.clearInterval(goToStartItem, 1);
//setTimeout(goToNextItem, 2000);
}
tried to add this function and call it
⌠by calling it from this button which is linked to the close button by id l on the svg element closed
<div id="Nw46" class="content"><svg xmlns
<path class="l"fill="#FFFFFF" stroke="none" d="
M 40.75 -18.45.
<g id="closed" transform="matrix( 1, 0, 0, 1, 8,196)
<path id="" class="l" data-pos = "0vh" fill="#000000" stroke="none" d="
M -14.7 -5.35
Q -15.05 -6.35 -16.4 -6.85 -17.8 -7.35 -18.6 -5.75 -19.45 -4.25 -17.7 4.25
L -17.65 5.75
so obviously my links are all a bit messed up because i have been mucking around with the code so much. but i still cant attatch to a item link or frame reference that works I think because the js loop is still active and as i understand it cant have 2 buttons with the same id and function linked in js without crafty code
function goToStartItem() {
activeLink = [0];
}
so I have created a function go to start item that acts on an element svg button closed to take it to first frame and changes its fill colours by acting on id l of that svg
<script>
window.addEventListener("DOMContentLoaded", () => {
const button = document.getElementById("closed");
let lightsOn = false;
button.addEventListener("click", () => {
const labels = document.querySelectorAll(".l");
labels[0].setAttribute("fill", lightsOn ? "white" : "#FFC05B");
labels[1].setAttribute("fill", lightsOn ? "white" : "#F86285");
lightsOn = !lightsOn;
goToStartItem()
});
});
</script>
blah dont understand your text editor itâs formatting is illusive or my code is bad, but you get the idea i hope - html
div id=âNw46â class=âcontentâ><svg xmlns=âSVG namespaceâ version=â1.1â xmlns:xlink=âhttp://www.w3.org/1999/ id=âclosedâ blah
path class=âl"fill=â#FFFFFFâ stroke=ânoneâ d=ââ blah
<path class=âlâ data-pos = â0vhâ fill=â#000000â stroke=ânoneâ d="/>blah end of svg
and this works like the replay button now i have to get it to stop on active link[0] initially i thought i could link by putting a data atribute on this button to add it to the array of images but that did not work either so will take that out
totally flumoxed think you need to explain what named functions do in your write up like what active link item id and all of it relate to linksâŚi and how they act on each other⌠or at least a hintâŚplease special k without reading and understanding the js bible all thousand pages dont know what to do please help
I think I understand what you are trying to say. The Close button appears here:
When the Close button is pressed, should the behavior be the same as what happens when you hit the Replay button?
Also, when pasting code, select your pasted code and click on the </>
Code formatting button in the toolbar. That will make sure the code displays properly.
Regarding this:
I do think that taking time to learn JavaScript (or preferably via my beginners-friendly Learn JavaScript guide) would be more beneficial for you than trying to reverse engineer a fairly complicated tutorial.
Thanks,
Kirupa
Thanks Kirupa yes will get on that guide, yes its that close button, but the function is not replay, it is go to start of animation and stop there.
div id=ânavLinksâ>
ul>
li class=âitemLinksâ data-pos=â0vhâ>
li class=âitemLinksâ data-pos=â-100vhâ>
li class=âitemLinksâ data-pos=â-200vhâ>
li class=âitemLinksâ data-pos=â-300vhâ>
li class=âitemLinksâ data-pos=â-400vhâ>
the itemLink data-pos=â0â the first one that is active stop here when you click close button
will look at all your updates give me a couple of weeks will start posting my discoveries after learning thank you K
been looking into the bible and learning slowly looking at timers and loops in relation to your js for my animation what is itemId is it just a name or is it a js command, does it separate and give links a separate id. Likewise e.target - an event target? like a button click, where do i search to explain because js is so intrinsic it helps if it is explained case for case for newbies like me.
You may actually find the tutorials here to be informative and more beginner-friendly than the JS Bible: Learn JavaScript: Visual and Beginner-Friendly Tutorials
If you start at the top and go down, youâll build-up your understanding of core JS concepts including the ones used by the slide show. I am almost certain that after a week, youâll be familiar enough with JavaScript to be able to create your own slideshow
thanks Kirupa sorry i meant that figuratively. I have been learning your javascript beginners guide.
Oh haha!
I have (a now older version of) the JS Bible, and it is a good book as a reference. Not for the faint of heart
yep I thought eloquent javascript was good love the quotes and the writing dont understand why it a got bad reputation�
:: Copyright KIRUPA 2024 //--