我想在不使用的情况下滚动 HTML 中的图像标签....在javascript的帮助下

发布于 2024-10-20 20:39:45 字数 42 浏览 2 评论 0原文

我只想在 javascript 中为图像提供动态效果...但不使用选框

i just want to give dynamic effect to Image in javascript...but without using of marquee

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

离笑几人歌 2024-10-27 20:39:45

标签中添加以下脚本

<head> 
    <script src="assets/js/crawler.js" type="text/javascript" ></script>
</head>

然后在

 marqueeInit({
                   uniqueid: 'mycrawler2',
                   style: {

                   },
                   inc: 5, //speed - pixel increment for each iteration of this marquee's movement
                   mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
                   moveatleast: 2, 
                   neutral: 150,
                   savedirection: true,
                   random: true
                });

之后,您必须添加一个 ID

标签中,

<div id="mycrawler2">
            <img src="assets/images/products/img1.png" />
            <img src="assets/images/products/img2.png" />
            <img src="assets/images/products/img3.png" />
            <img src="assets/images/products/img4.png" />
            <img src="assets/images/products/img5.png" />
            <img src="assets/images/products/img6.png" />
    </div>

它将对图像应用选取框效果,并且它们将连续移动。

Add this below script in <head> tag

<head> 
    <script src="assets/js/crawler.js" type="text/javascript" ></script>
</head>

And then add following code in <script> tag

 marqueeInit({
                   uniqueid: 'mycrawler2',
                   style: {

                   },
                   inc: 5, //speed - pixel increment for each iteration of this marquee's movement
                   mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
                   moveatleast: 2, 
                   neutral: 150,
                   savedirection: true,
                   random: true
                });

After this you have to add an ID in the <div> tag

<div id="mycrawler2">
            <img src="assets/images/products/img1.png" />
            <img src="assets/images/products/img2.png" />
            <img src="assets/images/products/img3.png" />
            <img src="assets/images/products/img4.png" />
            <img src="assets/images/products/img5.png" />
            <img src="assets/images/products/img6.png" />
    </div>

It will apply a marquee effect to images and they will move continuously.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文