我是编写 javascript 的新手,对 jQuery 非常陌生。我试图让这些 (3) 图像在身体负载时翻滚到页面顶部。它在 FF 和 Chrome 中运行良好,但在 MSIE、Safari 和 Opera 中根本不行。我不确定如何在此处包含我的 html 或 css。网站是 tumbleweedcolorado.com
这是javaScript,下面是html。
//external js file
function slideIn(el){
var elem = document.getElementById(el);
elem.style.transition = "left 5.0s ease-in 0s";
elem.style.left = "950px";
}
function slideOver(el){
var elem = document.getElementById(el);
elem.style.transition = "left 5.0s ease-in 0.7s";
elem.style.left = "950px";
}
function slideRight(el){
var elem = document.getElementById(el);
elem.style.transition = "left 5.0s ease-in 2.5s";
elem.style.left = "950px";
}
var looper;
var degrees = 0;
function rotateAnimation(el,speed){
var elem = document.getElementById(el);
if(navigator.userAgent.match("Chrome")){
elem.style.WebkitTransform = "rotate("+degrees+"deg)";
} else if(navigator.userAgent.match("Firefox")){
elem.style.MozTransform = "rotate("+degrees+"deg)";
} else if(navigator.userAgent.match("MSIE")){
elem.style.msTransform = "rotate("+degrees+"deg)";
} else if(navigator.userAgent.match("Opera")){
elem.style.OTransform = "rotate("+degrees+"deg)";
} else if(navigator.userAgent.match("Safari")){
elem.style.AppleWebKitTransform = "rotate("+degrees+"deg)";
} else {
elem.style.transform = "rotate("+degrees+"deg)";
}
looper = setTimeout('rotateAnimation(\''+el+'\','+speed+')',speed);
degrees++;
if(degrees > 359){
degrees = 1;
}
}