我想让我的动画有一个" L"方向。下降后,它将向右移动。但是当我尝试这样做时,它只会在对角线路径上移动。
(function () {
var speed = 50,
walkingCat = document.getElementById("catwalk"),
catWalk = function () {
left = walkingCat.offsetLeft,
moveBy = 10;
walkingCat.style.left = left + moveBy + "px";
if (left > 850) {
clearInterval(timer);
}
};
var timer = setInterval(catWalk, speed);
var catWalkDown = function () {
var top = walkingCat.offsetTop,
moveBy = 10;
walkingCat.style.top = top + moveBy + "px";
if (top > 850) {
clearInterval(timer2);
}
};
var timer2 = setInterval(catWalkDown, speed);
} ());
答案 0 :(得分:0)
试试这种方式 -
<强> HTML 强>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sitegroup/
RewriteRule ^pages/GA/GA_Be\.shtml$ http://www.example.com/sitegroup/garten-und-landschaftsbau/#gartenforum-ideengarten [R=301,L,NE]
RewriteRule ^pages/GA/GA_Bg\.shtml$ http://www.example.com/sitegroup/garten-und-landschaftsbau/#gartenplanung-landschaftsplanung [R=301,L,NE]
RewriteRule ^pages/GA/GA_En\.shtml$ http://www.example.com/sitegroup/garten-und-landschaftsbau/#erdsondenbohrung-erdwaerme [R=301,L,NE]
</IfModule>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /sitegroup/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /sitegroup/index.php [L]
</IfModule>
# END WordPress
并且在 的 JS 强>
<div id="catwalk" style="position:relative;width:5px;height:5px;background:black"> </div>