I'm trying to change the attribute, "scrollamount" to 0 in a javascript function for a Marquee Tag. However, it seems to have no effect on the scrolling animation. My original settings are set to scroll up at a scrollamount of 4. I've tried to change it in Javascript with:
document.getElementById("ledtxt").scrollamount="0";
and without quotes
document.getElementById("ledtxt").scrollamount=0;
The strange thing this is if I try to change the "direction" attribute it seems to respond.
document.getElementById("ledtxt").direction="down";
If I to change the attribute "behavior" to alternate, the text disappears. I think its there somewhere but is getting pushed, for whatever reason, out of the DIV container
document.getElementById("ledtxt").behavior="alternate";
I'm new to this and I'm trying to understand. I feel like this should work in theory based on the things I have read about changing attributes and it seems to work for one attribute but not the others. Any help would be appreciated.
Here is my codepen:
Marquee cannot change direction while running. You have to stop it, change direction then start again, but it will start from the beginning
This said, marquee is deprecated.DO NOT USE IT.
You can (and should) use CSS animations, like shown here:https://www.quackit.com/css/codes/marquees/.
Once implemented, you can use javascript to change the css animation.