gpt4 book ai didi

javascript - 图像不动

转载 作者:太空宇宙 更新时间:2023-11-03 18:53:18 24 4
gpt4 key购买 nike

我做了一个在背景中有动态图像的网页。

1. IE 和 Opera 只显示图像不会移动它。 (字体也不起作用)
2. Chrome 和 Safari 也移动图像。(但字体正确显示)
3. Firefox 根据需要移动图像。(但是字体不显示)

您可以在这里查看网站:http://ankitsuryawanshi.in/projects/404-html/

(编辑过的)CSS 代码在这里:

/*-----------------------------------------------------------------------
@FONT-FACE
------------------------------------------------------------------------*/
@font-face {
font-family: 'ChunkFive-Roman';
src: url('../fonts/Chunkfive-roman-webfont.eot');
src: url('../fonts/Chunkfive-roman-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/Chunkfive-roman-webfont.woff') format('woff'),
url('../fonts/chunkfive-roman-webfont.ttf') format('truetype'),
url('../fonts/chunkfive-roman-webfont.svg#ChunkFiveRegular') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'BloklettersBalpen';
src: url('../fonts/blokletters-balpen-webfont.eot');
src: url('../fonts/blokletters-balpen-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/blokletters-balpen-webfont.woff') format('woff'),
url('../fonts/blokletters-balpen-webfont.ttf') format('truetype'),
url('../fonts/blokletters-balpen-webfont.svg#BloklettersBalpen') format('svg');
font-weight: normal;
font-style: normal;

}

/*-----------------------------------------------------------------------
LETTERING SPECIFIC STYLES
------------------------------------------------------------------------*/
/* Logo H1 Text */
#logo .word1 {
margin-left: 3px;
}

#logo .word1 span {
display: inline-block;
position: relative;
letter-spacing: 0;
transition: width 0.2s;
}

#logo span:hover {
top: 4px;
}

/*-----------------------------------------------------------------------
DEFAULTS
------------------------------------------------------------------------*/
body {
color: #000;
background: #c1b69a url(../images/texture.jpg);
}

a {
color: #000;
text-decoration: none;
outline: none;
}

h1 {
font-family: 'ChunkFive-Roman', sans-serif;
color: #1e1e1e;
font-size: 60px;
font-weight: 500;
line-height: 1;
text-transform: none;
}

h2 {
font-family: 'ChunkFive-Roman', sans-serif;
color: #1e1e1e;
font-size: 114px;
font-weight: 800;
line-height: 1;
text-transform: uppercase;
text-shadow: #62b445 1px 1px 0, #62b445 2px 2px 0, #62b445 3px 3px 0, #45a5f6 4px 4px 0, #45a5f6 5px 5px 0, 5px 8px 10px rgba(0,0,0,.35);
}

h3 {
font-size: 46px;
font-weight: bold;
line-height: 1.5;
color: #262626;
}

h4 {
font-family: 'ChunkFive-Roman', sans-serif;
font-size: 26px;
color: #262626;
margin-bottom: 20px;
font-style: normal;
text-transform: uppercase;
}

.written {
font-family: 'BloklettersBalpen',sans-serif;
font-size: 18px;
color: #000;
}

.written-small {
font-family: 'BloklettersBalpen', sans-serif;
font-size: 14px;
color: #000;
}

p {
font-size: 20px;
color: #000;
}

/* About Page Definitions Area */
.col-def-plus p,.col-def-equals p {
font-size: 80px;
font-weight: 800;
}

.col-def p {
font-size: 18px;
}

div.col-def p.word-break {
font-size: 28px;
font-weight: 900;
color: #000;
}

div.col-def p.word-def {
font-size: 14px;
line-height: 1.7;
margin-top: 12px;
font-style: italic;
color: #333;
}

#shareTab {
font-family: 'ChunkFive-Roman', sans-serif;
}

/*-----------------------------------------------------------------------
COMMON CLASSES
------------------------------------------------------------------------*/
.clear {
clear: both;
}

.wrap {
max-width: 960px;
width: 100%;
margin: 0 auto;
}

.fr {
float: right;
}

.fl {
float: left;
}

.ac {
text-align: center;
}

.line-through {
text-decoration: line-through;
}

.underline {
text-decoration: underline;
}

/*-----------------------------------------------------------------------
FLOATING BACKGROUND IMAGES
------------------------------------------------------------------------*/
#clouds {
z-index: -1;
background: url(../images/clouds.png);
position: absolute;
width: 100%;
height: 736px;
display: block;
}

@keyframes "float-clouds" {
0% {
background-position: 2400px 0;
}
100% {
background-position: 0 0;
}

}

@-moz-keyframes float-clouds {
0% {
background-position: 2400px 0;
}
100% {
background-position: 0 0;
}

}

@-webkit-keyframes "float-clouds" {
0% {
background-position: 2400px 0;
}
100% {
background-position: 0 0;
}

}

@-ms-keyframes "float-clouds" {
0% {
background-position: 2400px 0;
}
100% {
background-position: 0 0;
}

}

@-o-keyframes "float-clouds" {
0% {
background-position: 2400px 0;
}
100% {
background-position: 0 0;
}

}

#clouds {
animation-name: float-clouds;
-webkit-animation-duration: 95s;
animation-iteration-count: infinite;
animation-timing-function: linear;
-moz-animation-duration: 95s;
-o-animation-duration: 95s;
-ms--animation-duration: 95s;
}

如何更正此处的所有内容,使其在所有浏览器中都能正常工作。

这是图像移动的JS代码:

       $(document).ready(function() {
$("#logo h1, .nav-here-home, .nav-here-about, .home-page-tag h3, .about-page-tag h3, .written").lettering('words').children('span').lettering();
$(".home-intro h2").fitText(.86);
$(".about-intro h2").fitText(.86);

});


// --------------------------------------------------- //
// Background Image Floating //
// --------------------------------------------------- //
$(document).ready(function() {
if (!$.browser.webkit){
var clouds = $('#clouds');
var background = 0;
setInterval(function(){
background -= 2;
if (background == 1200) background = 0;
clouds.css('background-position', background)
}, 95)
}
})

我现在应该在哪里编辑它?

最佳答案

我创建了一个 DEMO

希望这就是您要找的。尽管您需要根据需要进行一些调整。

关于javascript - 图像不动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14255039/

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