HTML5 implementing the link jumper effect

Source: Internet
Author: User

We have previously released the flex version of the link jumper effect, now based on the new version of HTML5 jumper effect is also implemented, the nuances of which we have improved, such as link tilt when the offset direction is always vertical and so on. Look at the effect first.


The implementation of the algorithm and flex basically consistent, in this does not do further analysis, the algorithm used in the matrix operation, so in this paste the matrix operation of the package.

var matrix=function (options) {if (!) (    This instanceof Arguments.callee) {return new Arguments.callee (options); } this.init (options);};    matrix.prototype={init:function (options) {This.matrix=options.matrix;        }, Add:function (MTX) {var Omtx=this.matrix;        var newmtx=[]; if (!mtx.length| |! mtx[0].length| | mtx.length!=omtx.length| |        Mtx[0].length!=omtx[0].length) {return;            } for (Var i=0,len1=omtx.length;i<len1;i++) {var rowmtx=omtx[i];            Newmtx.push ([]);            for (Var j=0,len2=rowmtx.length;j<len2;j++) {Newmtx[i][j]=rowmtx[j]+mtx[i][j];        }} this.matrix=newmtx;    return this;                }, Multiply:function (MTX) {var omtx = Mtx.matrix;                var mtx = This.matrix;                var newmtx=[]; if (!isnan (MTX)) {for (Var i=0,len1=omtx.length;i<len1;i++) {var rowmtx=omtx[i]  ;                      Newmtx.push ([]);                            for (Var j=0,len2=rowmtx.length;j<len2;j++) {omtx[i][j]*=mtx;                }} return new Matrix ({matrix:newmtx});                } var sum=0;                        for (Var i=0,len1=omtx.length;i<len1;i++) {var rowmtx=omtx[i];                    Newmtx.push ([]);                            for (Var m=0,len3=mtx[0].length;m<len3;m++) {for (Var j=0,len2=rowmtx.length;j<len2;j++) {                            SUM+=OMTX[I][J]*MTX[J][M];                        } newmtx[newmtx.length-1].push (sum);                    sum=0;                }} this.matrix=newmtx;                    return this;        }                    }; This. Matrix=matrix;



Only the addition and multiplication are encapsulated, and the other arithmetic methods can transform the matrix expression, such as translation, rotation, and so on. If you need source code, you can apply for email. [Email protected]

HTML5 implementing the link jumper effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.