Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

once parameter for events #600

Open
eckeriaue opened this issue Jan 5, 2025 · 0 comments
Open

once parameter for events #600

eckeriaue opened this issue Jan 5, 2025 · 0 comments

Comments

@eckeriaue
Copy link

eckeriaue commented Jan 5, 2025

I tried to perform a loader mapping to upload images as follows:

<span>
    <img
        data-script="on load remove the next <span#loader/>"
        src="link to any photo"
    >
    <span id="loader"  />
 </span>

but the problem is that when the src attribute is changed, the load event fires again. Although the #loader element has already been removed from dom.

<span>
    <img
        data-script="on load remove the next <span#loader/>"
        src="link to any photo"
    >
    <span id="loader"  />
 </span>
    
    
    <script> setTimeout(() => {
      document.querySelector`img`.src = `any other photo reference`
    }, 1000) </script>

I think some modifier is required here to solve the problem, but I haven't found anything in the documentation

this is the only way I've been able to solve the problem so far. But I am confused that the event is not removed from the dom element


            on load
            if the next <span#loader />
                remove the next <span#loader/>
            end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant