简体   繁体   English

跨浏览器的过渡和转换问题

[英]Cross-browser transition and transform issues

I'm having issues while building my new website. 建立新网站时出现问题。

I have a mobile nav that shows up whenever your browser is small enough (I believe under 940px wide) and it works fine on Chrome and other webkit browsers, but in Firefox and IE the transitions don't work and nothing transforms the way I want it to. 每当您的浏览器足够小(我相信宽度不超过940像素)时,我都会显示一个移动导航,并且它可以在Chrome和其他Webkit浏览器上正常运行,但是在Firefox和IE中,转换无法正常工作,并且没有任何方法可以改变我想要的方式它来。 I'm not really sure why this is and could use help. 我不太确定为什么会这样并且可以使用帮助。

Here's a link to the site: http://teamreest.com/ 这是该网站的链接: http : //teamreest.com/

EDIT: I am using the specific vendor prefixes, yet it still does not work. 编辑:我正在使用特定的供应商前缀,但它仍然无法正常工作。

More specifically relating to this: 更具体地与此相关:

.overlay{
  position: fixed;
  top: 0;
  height: 100%;
  width: 100%;
  background: $main-color;
  overflow: auto;
  z-index:100;
  font-size:50px;
  font-weight:300;
  min-height:400px;

  -webkit-transition: -webkit-transform 0.4s;
  -moz-transition: -moz-transform 0.4s;
  -ms-transition: -ms-transform 0.4s;
  transition: -transform 0.4s;

  -webkit-transform: translateX(-100%);
  -moz-transform: translateX(-100%);
  -ms-transform: translateX(-100%);
  transform: translateX(-100%);
}

.overlay.show {
  opacity:1;

  -webkit-transform: translateX(0%);
  -moz-transform: translateX(0%);
  -ms-transform: translateX(0%);
  transform: translateX(0%);
}

Also this: 还有这个:

.container{
  height:100%;
  opacity: 1;

  -webkit-transition: -webkit-transform 0.4s, opacity 0.4s;
  -moz-transition: -moz-transform 0.4s, opacity 0.4s;
  -ms-transition: -ms-transform 0.4s, opacity 0.4s;
  transition: -transform 0.4s, opacity 0.4s;
}

.container.show {
  opacity: 0.5;

  -webkit-transform: translateX(30%);
  -moz-transform: translateX(30%);
  -ms-transform: translateX(30%);
  transform: translateX(30%);
}

I found the issue in my code. 我在代码中找到了问题。

The transition as seen here: 转换如下所示:

  -webkit-transition: -webkit-transform 0.4s;
  -moz-transition: -moz-transform 0.4s;
  -ms-transition: -ms-transform 0.4s;
  transition: -transform 0.4s;

And here: 和这里:

  -webkit-transition: -webkit-transform 0.4s, opacity 0.4s;
  -moz-transition: -moz-transform 0.4s, opacity 0.4s;
  -ms-transition: -ms-transform 0.4s, opacity 0.4s;
  transition: -transform 0.4s, opacity 0.4s;

Are problematic. 有问题。 As seen, the regular transition property has an issue. 如图所示,常规过渡属性存在问题。 That issue can be seen as there is a dash in front of the transform property of the transition. 可以看到该问题是因为过渡的transform属性前面有一个破折号。 By removing this the problem is solved. 通过消除此问题,解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM