File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- Copyright (c) 2014 Jim Chen
1+ Copyright (c) 2017 Jim Chen
22
33Permission is hereby granted, free of charge, to any person obtaining a copy of this software
44and associated documentation files (the "Software"), to deal in the Software without restriction,
Original file line number Diff line number Diff line change @@ -655,21 +655,24 @@ var CssScrollComment = (function (_super) {
655655 return ( this . ttl / this . dur ) * ( this . parent . width + this . width ) - this . width ;
656656 } ,
657657 set : function ( x ) {
658- if ( typeof this . _x === "number" ) {
658+ if ( this . _x !== null && typeof this . _x === "number" ) {
659659 var dx = x - this . _x ;
660660 this . _x = x ;
661- CssCompatLayer . transform ( this . dom , "translateX(" + dx + "px)" ) ;
661+ CssCompatLayer . transform ( this . dom , "translateX(" +
662+ ( this . axis % 2 === 0 ? dx : - dx ) + "px)" ) ;
662663 }
663664 else {
664665 this . _x = x ;
665666 if ( ! this . absolute ) {
666667 this . _x *= this . parent . width ;
667668 }
668- if ( this . align % 2 === 0 ) {
669- this . dom . style . left = this . _x + "px" ;
669+ if ( this . axis % 2 === 0 ) {
670+ this . dom . style . left =
671+ ( this . _x + ( this . align % 2 === 0 ? 0 : - this . width ) ) + 'px' ;
670672 }
671673 else {
672- this . dom . style . right = this . _x + "px" ;
674+ this . dom . style . right =
675+ ( this . _x + ( this . align % 2 === 0 ? - this . width : 0 ) ) + 'px' ;
673676 }
674677 }
675678 } ,
@@ -688,10 +691,11 @@ var CssScrollComment = (function (_super) {
688691 this . _dirtyCSS = true ;
689692 } ;
690693 CssScrollComment . prototype . stop = function ( ) {
691- this . dom . style . transition = "" ;
694+ _super . prototype . stop . call ( this ) ;
695+ this . dom . style . transition = '' ;
692696 this . x = this . _x ;
693697 this . _x = null ;
694- this . x = ( this . ttl / this . dur ) * ( this . parent . width + this . width ) - this . width ;
698+ this . x = this . x ;
695699 this . _dirtyCSS = true ;
696700 } ;
697701 return CssScrollComment ;
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ Alignment: 对齐锚点(方形四角)。此数的高位表示上下,低位
8383设定后x,y坐标的锚点将变成对应的方形角。不过,在右和下的对齐时,读取 x,y 坐标不一定准确,而且因为
8484效率低所以不推荐。比如 top right 模式下,读 x 坐标效率比较低,但是读 y 就要好很多。
8585
86- 注意:` >4 ` 的模式未必在所有状态下都支持!
86+ 注意:` >= 4 ` 的模式未必在所有状态下都支持!
8787
8888### absolute < ; Bool> ; = true
8989Absolute Coordinates: 是否使用绝对坐标。当 ` absolute === false ` 时,x,y坐标将会表示相对
You can’t perform that action at this time.
0 commit comments