网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 jQuery+CSS3文字跑马灯特效的简单实现
内容
    下面小编就为大家带来一篇jQuery+CSS3文字跑马灯特效的简单实现。小编觉得挺不错的,现在就分享给大家看,也给大家做个参考。
    完整HTML代码如下:
    <!DOCTYPE html>
    <html lang="zh">
    <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery+CSS3文字跑马灯特效 - 何问起</title><base target="_blank" />
    <link rel="stylesheet" href="http://hovertree.com/texiao/jquery/83/css/style.css">
    </head>
    <body>
    <div id="hovertreemarquee">
      <div><span>I ❤ HoverTree 我❤何问起 </span></div>
      <div aria-hidden="true"><span>I ❤ HoverTree 我❤何问起 </span></div>
    </div>
    <form onsubmit="setText(event)">
      <label for="textsource">使用你自己的文本</label>
      <input type="text" id="textsource" value="hwq2.com Is A Good Site!" autocapitalize="characters" pattern=".{5,60}" placeholder="请输入文本:hovertree.com">
      <input type="submit" value="使用">
    </form>
      <div><p>可以输入其他文本,然后点击“使用”按钮。<br />
        例如:1314520 hovertree.com 
           <br />或者: 欢迎访问何问起
        <br />
                <a href="http://hovertree.com/h/bjaf/bmfmnq8a.htm">特殊爱心符号点这里</a>
        <br />何问起提示:可以放大或者缩小浏览器宽度查看效果。
        </p></div>
    <script src="http://down.hovertree.com/jquery/jquery-2.2.4.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function setText(event){
         event.preventDefault();
         leftText.innerText = textsource.value.toUpperCase();
         rightText.innerText = textsource.value.toUpperCase();
        }
        var leftText = document.querySelector("#hovertreemarquee div:first-of-type span");
        var rightText = document.querySelector("#hov"+"ertreemarquee div:last-of-type span");
        var textsource = document.getElementById("textsource");
        setText();
    </script>
    <div>
    <p>适用浏览器:FireFox、Chrome、Edge、Safari、Opera、傲游、搜狗、世界之窗、IE11. 不支持IE8及以下浏览器。</p>
    <p>来源:<a href="http://hovertree.com/" target="_blank">何问起</a> <a href="http://hovertree.com/menu/texiao/">网页特效</a>
    <a href="http://hovertree.com/h/bjaf/paomadeng.htm">代码说明</a></p>
    </div>
    </body>
    </html>
    以上就是小编为大家带来的jQuery+CSS3文字跑马灯特效的简单实现全部内容了
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/21 19:21:24