2017-10-13 132 views
0

我有一个加载页面,而网站正在加载。它在Chrome中工作正常,但我需要在Safari上修复它,因为它不起作用。这里是我的代码:转换:旋转在Safari中不工作

.se-pre-con { 
 
    position: fixed; 
 
    left: 0px; 
 
    top: 0px; 
 
    width: 100%; 
 
    height: 100%; 
 
    z-index: 9999; 
 
    background-color: #fff; 
 
} 
 

 
.loading { 
 
    top: 30%; 
 
    right: 45%; 
 
    position: fixed; 
 
    -webkit-animation: spinHorizontal 4s linear infinite; 
 
    -moz-animation: spinHorizontal 4s linear infinite; 
 
    animation: spinHorizontal 4s linear infinite; 
 
} 
 

 
@keyframes spinHorizontal { 
 
    0% { 
 
    transform: rotateY(0deg); 
 
    } 
 
    100% { 
 
    transform: rotateY(360deg); 
 
    } 
 
}
<div class="se-pre-con"> 
 
    <div class="loading"> 
 

 
    <img src="http://www.pngmart.com/files/4/Circle-PNG-Picture-279x279.png"> 
 
    </div>

+0

能否请你也分享你的HTML? –

+0

完成@BrettDeWoody –

+0

不一定是解决方案,但您的图片标签需要接近有效的html像这样:

回答

0

看来它与position: fixed.se-pre-con元素上做。尝试使用absolute以其他方式进行定位或定位。

.se-pre-con { 
 
    left: 0px; 
 
    top: 0px; 
 
    width: 100%; 
 
    height: 100%; 
 
    z-index: 9999; 
 
    background-color: #ffffff; 
 
} 
 

 
.loading { 
 
    width: 279px; 
 
    height: 279px; 
 
    top: 30%; 
 
    right: 45%; 
 
    position: fixed; 
 
    -webkit-backface-visibility: visible; 
 
    -webkit-animation: spinHorizontal 2s linear infinite; 
 
    -moz-animation: spinHorizontal 2s linear infinite; 
 
    animation: spinHorizontal 2s linear infinite; 
 
    background-color: transparent; 
 
} 
 

 
@keyframes spinHorizontal { 
 
    0% { 
 
    -webkit-transform: rotateY(0deg); 
 
    transform: rotateY(0deg); 
 
    } 
 
    100% { 
 
    -webkit-transform: rotateY(180deg); 
 
    transform: rotateY(180deg); 
 
    } 
 
}
<div class="se-pre-con"> 
 
    <div class="loading"> 
 

 
    <img src="http://www.pngmart.com/files/4/Circle-PNG-Picture-279x279.png" /> 
 
    </div> 
 
</div>

+0

它的工作原理,但我需要在网站加载之前的白色背景,所以现在它显示加载@布雷特的网站内容DeWoody –

+0

好的。我发现了另一个可能导致它的问题 - “位置:固定”。 –