gpt4 book ai didi

javascript - Chrome 中的 CSS 和 JavaScript 幻灯片问题

转载 作者:太空宇宙 更新时间:2023-11-04 05:19:26 25 4
gpt4 key购买 nike

我正在建立一个网站,教 1 到 6 岁的 child 如何写字。
学习方法的核心是单词幻灯片。我是用 CSS 和 javascript 制作的。

在 Safari(包括 iPhone 和 iPad)中一切正常,但我在 Chrome 中看不到幻灯片。

我是菜鸟开发者,找不到问题。

这是一个免费元素,很多人如果不下载 Safari 或 Firefox 就无法使用该网站。

我感谢任何形式的帮助。

链接:http://www.rojasandco.com/castellano/empecemos.html

代码:

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="refresh" content="12;URL=../empecemos.html#semana14">
<title>Prueba02 &middot; Made with Sencha Animator</title>
<script type="text/javascript">
function setConfig(configObject) {
config = configObject;

//get ol list and children
var ol = document.body.getElementsByTagName('ol')[0];
scenes = ol.children;

currentSceneIndex = -1;
}


function start() {
goToScene(0);
}

function goToSceneID(id) {
for (var i=0; i < config.length; i++) {
if (config[i].id === id) {
goToScene(i);
return;
}
}
}


//function to go directly to any scene
function goToScene(index) {

//go to scene
startScene(index);

//set up timer if jumping on done
if (config[index].jump !== -1) {
applyTimeout(config[index].jump, config[index].duration);
}

}

function startScene(index) {

//restart current scene without flicker
if (index === currentSceneIndex) {
scenes[index].setAttribute('class','run restart');
setTimeout(function(){
scenes[index].setAttribute('class','run');
},0);
return;
}

//add the class "run" to the scene currently running and remove it from anybody else
var scene;
for (var i=0; i < scenes.length; i++) {
scene = scenes[i];
if (i === index) {
scene.setAttribute('class','run');
} else {
scene.setAttribute('class','');
}

}

currentSceneIndex = index;

}

//set timeout
function applyTimeout(index,time) {
setTimeout(function(){
goToScene(index);
},time);
}
</script><script type="text/javascript">
window.onload=setup;
function setup() {
setConfig([{"jump":-1,"duration":11250,"id":0}]);
start();
}
</script>
<style type="text/css">
.AN-sObj-stage {
position: relative;
overflow:hidden;
-webkit-perspective: 600;
-webkit-transform-style:preserve-3d;
margin: 0px auto;
}
.AN-sObj-stage div {
position: absolute;
}
.AN-sObj-stage a {
color: inherit;
text-decoration:none;
}
.AN-sObj-stage * {
margin:0;
padding:0;
-webkit-font-smoothing: antialiased;
}
body, .AN-sObj-stage, ol, li {
margin:0;
padding:0;
}
ol {
list-style:none;
position:relative;
}
li {
position:absolute;
top:0;
left:0;
}
li {
display:none;
}
li.run {
display:block;
}
.restart * {
-webkit-animation-name: none !important;
}
.AN-sObj-stage {
height: 768px;
width: 1024px;
background-color: rgba(255,255,255,1);
margin: 0px auto;
}
#AN-sObj-2 {
-webkit-transform: translate3d(10px, 10px, 0px);
width: 100px;
height: 100px;
top:0;
left:0;
}
#AN-sObj-4 {
-webkit-transform: translate3d(10px, 10px, 0px);
width: 1024px;
height: 768px;
top:0;
left:0;
}
#AN-sObj-5 {
-webkit-transform: translate3d(10px, 10px, 0px);
width: 1024px;
height: 768px;
top:0;
left:0;
}
#AN-sObj-6 {
-webkit-transform: translate3d(10px, 10px, 0px);
width: 1024px;
height: 768px;
top:0;
left:0;
}
#AN-sObj-7 {
-webkit-transform: translate3d(10px, 10px, 0px);
width: 1024px;
height: 768px;
top:0;
left:0;
}
#AN-sObj-8 {
-webkit-transform: translate3d(10px, 10px, 0px);
width: 1024px;
height: 768px;
top:0;
left:0;
}
div {
width:1024px;
height:768px;
margin: 0px auto;
}
@-webkit-keyframes AN-ani-3 {
0% {
-webkit-transform: translate3d(10px, 10px, 0px);
}
100% {
-webkit-transform: translate3d(10px, 10px, 0px);
}
}
.run #AN-sObj-2 {
-webkit-animation-name: AN-ani-3;
-webkit-animation-duration: 11s;
-webkit-animation-delay: 0s;
-webkit-animation-fill-mode: both;
}
.restart #AN-sObj-2 {
-webkit-transform: translate3d(10px, 10px, 0px);
}
@-webkit-keyframes AN-ani-9 {
0% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity:0;
}
0.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
98.04% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
99.02% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
100% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 0;
}
}
.run #AN-sObj-8 {
-webkit-animation-name: AN-ani-9;
-webkit-animation-duration: 1.02s;
-webkit-animation-delay: 1s;
-webkit-animation-fill-mode: both;
}
.restart #AN-sObj-8 {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
@-webkit-keyframes AN-ani-10 {
0% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity:0;
}
0.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
99.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
100% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 0;
}
}
.run #AN-sObj-7 {
-webkit-animation-name: AN-ani-10;
-webkit-animation-duration: 1.0099999999999998s;
-webkit-animation-delay: 3s;
-webkit-animation-fill-mode: both;
}
.restart #AN-sObj-7 {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
@-webkit-keyframes AN-ani-11 {
0% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity:0;
}
0.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
99.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
100% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 0;
}
}
.run #AN-sObj-6 {
-webkit-animation-name: AN-ani-11;
-webkit-animation-duration: 1.0099999999999998s;
-webkit-animation-delay: 5s;
-webkit-animation-fill-mode: both;
}
.restart #AN-sObj-6 {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
@-webkit-keyframes AN-ani-12 {
0% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity:0;
}
0.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
99.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
100% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 0;
}
}
.run #AN-sObj-4 {
-webkit-animation-name: AN-ani-12;
-webkit-animation-duration: 1.0099999999999998s;
-webkit-animation-delay: 9s;
-webkit-animation-fill-mode: both;
}
.restart #AN-sObj-4 {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
@-webkit-keyframes AN-ani-13 {
0% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity:0;
}
0.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
99.01% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
100% {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 0;
}
}
.run #AN-sObj-5 {
-webkit-animation-name: AN-ani-13;
-webkit-animation-duration: 1.0099999999999998s;
-webkit-animation-delay: 7s;
-webkit-animation-fill-mode: both;
}
.restart #AN-sObj-5 {
-webkit-transform: translate3d(10px, 10px, 0px);
opacity: 1;
}
</style>
</head>
<body>
<div>
<ol>
<li id="scene-0">
<div class="AN-sObj-stage" id="ext-gen7487">
<div id="AN-sObj-2"></div>
<div class="AN-Object" id="AN-sObj-4">
<div id="AN-sObj-val-4"><img src="animacion/assets/60d.png"></div>
</div>
<div class="AN-Object" id="AN-sObj-5">
<div id="AN-sObj-val-5"><img src="animacion/assets/60c.png"></div>
</div>
<div class="AN-Object" id="AN-sObj-6">
<div id="AN-sObj-val-6"><img src="animacion/assets/60a.png"></div>
</div>
<div class="AN-Object" id="AN-sObj-7">
<div id="AN-sObj-val-7"><img src="animacion/assets/60e.png"></div>
</div>
<div class="AN-Object" id="AN-sObj-8">
<div id="AN-sObj-val-8"><img src="animacion/assets/60b.png"></div>
</div>
</div>
</li>
</ol>
</div>
</body>
</html>

最佳答案

您应该考虑使用 jQuery用于成熟的、跨浏览器测试的动画

关于javascript - Chrome 中的 CSS 和 JavaScript 幻灯片问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7016064/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com