您好,欢迎来到源码搜藏!分享精神,快乐你我!提示:担心找不到本站?在百度搜索“源码搜藏”,网址永远不丢失!
  • 首 页
  • 在线工具
  • 当前位置:首页 > 网页特效 > 鼠标特效 >

    幻影文字跟随鼠标效果

    时间:2013-05-09 10:08 来源:互联网 作者:源码搜藏 浏览:收藏 挑错 推荐 打印
    运行代码保存代码复制代码 提示:您可以先修改部分代码再运行,保存代码功能在Firefox下无效。
    幻影文字跟随鼠标效果

    跟随鼠标的幻影文字,自定义文字。

    <html>
    <head>
    <meta name="keywords" content="站长,网页特效,js特效,广告代码,codesocang,codesocang.net,sky,www.codesocang.com,源码搜藏网" />
    <meta name="description" content="www.codesocang.com,源码搜藏网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在源码搜藏网" />
    <title>幻影文字跟随鼠标效果,sky整理收集,codesocang.net欢迎您。</title>
    </head>
    <body>
    <a href="<#ZC_BLOG_HOST#>">源码搜藏网</a>,站长必备的高质量网页特效和广告代码。codesocang.net,站长js特效。<hr>
    <!--欢迎来到源码搜藏网,我们网站收集大量高质量js特效,提供许多广告代码下载,网址:www.codesocang.com,codesocang@msn.com,用.net打造靓站-->
    <script LANGUAGE="JavaScript">
    <!--    Begin
        message = '欢迎来到源码搜藏网,codesocang.com';
        FonT = 'Verdana';
        ColoR = 'ff0000';
        SizE = 3; //1 to 7 only!
        var amount = 5, ypos = -50, xpos = 0, Ay = 0, Ax = 0, By = 0, Bx = 0, Cy = 0, Cx = 0, Dy = 0, Dx = 0, Ey = 0, Ex = 0;
        if (document.layers)
        {
            for (i = 0; i < amount; i++)
            {
                document.write('<layer name=nsl' + i + ' top=0 left=0><font face=' + FonT + ' size=' + SizE + ' color=' + ColoR + '>' + message + '</font></layer>');
            }
            window.captureEvents(Event.MOUSEMOVE);
            function nsmouse(evnt)
            {
                xpos = evnt.pageX + 20;
                ypos = evnt.pageY + 20;
            }
            window.onMouseMove = nsmouse;
        }
        else if (document.all)
        {
            document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
            document.write("<div style='position:relative'>");
            for (i = 0; i < amount; i++)
            {
                document.write('<div id="text"' + i + ' style="position:absolute;top:0px;left:0px;width:400px;height:20px"><font face=' + FonT + ' size=' + SizE + ' color=' + ColoR + '>' + message + '</font></div>')
            }
            document.write("</div>");
            document.write("</div>");
            function iemouse()
            {
                ypos = event.y + 20;
                xpos = event.x + 20;
            } //欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
            window.document.onmousemove = iemouse;
        }
        function makefollow()
        {
            if (document.layers)
            {
                document.layers['nsl' + 0].top = ay;
                document.layers['nsl' + 0].left = ax;
                document.layers['nsl' + 1].top = by;
                document.layers['nsl' + 1].left = bx;
                document.layers['nsl' + 2].top = cy;
                document.layers['nsl' + 2].left = cx;
                document.layers['nsl' + 3].top = Dy;
                document.layers['nsl' + 3].left = Dx;
                document.layers['nsl' + 4].top = Ey;
                document.layers['nsl' + 4].left = Ex;
            }
            else if (document.all)
            {
                outer.style.pixelTop = document.body.scrollTop;
                text[0].style.pixelTop = ay;
                text[0].style.pixelLeft = ax;
                text[1].style.pixelTop = by;
                text[1].style.pixelLeft = bx;
                text[2].style.pixelTop = cy;
                text[2].style.pixelLeft = cx;
                text[3].style.pixelTop = Dy;
                text[3].style.pixelLeft = Dx;
                text[4].style.pixelTop = Ey;
                text[4].style.pixelLeft = Ex;
            }
        }
        function move()
        {
            ey = Ey += (ypos - Ey) * 0.2;
            ex = Ex += (xpos - Ex) * 0.2;
            dy = Dy += (ey - Dy) * 0.3;
            dx = Dx += (ex - Dx) * 0.3;
            cy = Cy += (dy - Cy) * 0.4;
            cx = Cx += (dx - Cx) * 0.4;
            by = By += (cy - By) * 0.5;
            bx = Bx += (cx - Bx) * 0.5;
            ay = Ay += (by - Ay) * 0.6;
            ax = Ax += (bx - Ax) * 0.6;
            makefollow();
            setTimeout('move()', 100);
        } //欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
        window.onload = move;
    //  End -->
    </script>
    </body>
    </html>

    幻影文字跟随鼠标效果由源码搜藏网整理,转载请注明出处http://www.codesocang.com/texiao/shubiaotexiao/4634.html
    标签:网站源码