Using marquee functionality in JavaScript

makumbi
 
on Dec 08, 2022 02:45 AM
529 Views

How can use JavaScript to implemet this marquee functionality.

<MARQUEE>
    <span class="style1">ON LINE CATALOGUE</span>
</marquee>
Download FREE API for Word, Excel and PDF in ASP.Net: Download
arjunv
 
on Dec 08, 2022 04:10 AM
on Dec 08, 2022 04:25 AM

Hi makumbi,

As per your requirement I am trying to get MARQUEE functionality through JavaScript but I got MARQUEE functionality through jQuery you can try below code.

HTML

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
    (function () {
        const script = document.createElement("script");
        const s0 = document.getElementsByTagName("script")[0];
        script.async = true;
        script.src = "https://api.adnan-tech.com/public/js/at.js";
        script.setAttribute("crossorigin", "*");
        s0.parentNode.insertBefore(script, s0);

        script.onload = function () {
            at.loadMarquee("#style1", document.getElementById("style1").innerHTML, {
                duration: 20, // seconds
                direction: "rtl"
            });
        };
    })();
</script>
<span id="style1">ON LINE CATALOGUE</span>

Demo