简体   繁体   English

滚动条不可见,CSS3过渡在MOZ中不起作用

[英]Scrollbar not visible and CSS3 transition not working in MOZ

I've created a webpage which has two main div's and those being displayed on button clicks. 我创建了一个包含两个主要div的网页,这些网页在单击按钮时显示。

FIDDLE . FIDDLE

Problem is when I click the first button, the first div is moved -150% on y-axis using the css3 transform and the second div appears. 问题是,当我单击第一个按钮时,使用css3 transform将第一个div在y-axis移动了-150%,并且出现了第二个div

When i click the button on the second div , second div is moved down on y-axis and the first div is visible. 当我单击第二个div上的按钮时,第二个div在y-axis向下y-axis ,第一个div可见。 But when the first div is visible, scrollbar is not visible. 但是当第一个div可见时,滚动条不可见。

To check whether the scrollbar is visible or not in the firefox the css3 transitions are not working in the firefox . 要检查scrollbarfirefox是否可见,css3 transitionsfirefox不起作用。

And everything in the webpage is working only on fullscreen. 网页中的所有内容都只能在全屏模式下使用。 If i resize the window order of everything is misplaced and i couldn't click on the button too. 如果我调整大小,则所有内容的窗口顺序都会放错位置,并且我也无法单击该button

Someone please help me in fixing this. 有人请帮我解决这个问题。

CSS3: CSS3:

.summary-hidden {
    -webkit-animation: top 0.6s ease both;
}
.content-visible {
    -webkit-animation: top 0.6s ease both;  
}
.content-hidden {
    -webkit-animation: bottom 0.6s ease both;
}
.summary-visible {
    -webkit-animation: bottom 0.6s ease both;
    overflow-y: visible;
}
@-webkit-keyframes top {
    from {-webkit-transform: translateY(0%);}
    to {-webkit-transform: translateY(-110%);}
}
@-moz-keyframes top {
    from {-moz-transform: translateY(0%);}
    to {-moz-transform: translateY(-115%);}
}
@-webkit-keyframes bottom {
    from {-webkit-transform: translateY(-110%);}
    to {-webkit-transform: translateY(0%);}
}
@-moz-keyframes bottom {
    from {-moz-transform: translateY(-110%);}
    to {-mo-ztransform: translateY(0%);}
}

JQUERY: JQUERY:

$('.button-summary').click(function() {
    $('#container').removeClass('summary-visible').addClass('summary-hidden');
    $('#content').removeClass('content-hidden hide').addClass('content-visible show');
});

$('.button-content').click(function() {
    $('#container').removeClass('summary-hidden').addClass('summary-visible')
    $('#content').removeClass('content-visible show').addClass('content-hidden hide');
});

Based on what I am seeing in your fiddle you do not actually have a non-prefixed 根据我在您的小提琴中看到的内容,您实际上没有非前缀

animation property, even though you have defined -moz-keyframes rules. 动画属性,即使您已定义-moz-keyframes规则。

http://caniuse.com/#feat=css-animation http://caniuse.com/#feat=css-animation

Currently you can use the unprefixed animations property for pretty much any recent version of Mozilla (which according to that link has always supported the spec sans-prefix). 当前,您几乎可以将unprefixed animations属性用于Mozilla的任何最新版本(根据该链接,该版本始终支持规范sans-prefix)。

It is worth mentioning to note that really you do not need to insert the -moz prefix for the keyframes rules unless you need to support Firefox versions before v16 ( http://paulrouget.com/e/unprefixing-in-firefox-16/ ). 值得一提的是,除非您需要在v16之前支持Firefox版本,否则实际上不需要为关键帧规则插入-moz前缀( http://paulrouget.com/e/unprefixing-in-firefox-16/ )。

Personally, I wouldn't even just use -webkit and -moz without covering my bases with (at minimum) the unprefixed version of the property, or even included -o, -ms (depends on the client and situation). 就个人而言,我什至不会只使用-webkit和-moz而不用(至少)使用该属性的未前缀版本覆盖我的基础,或者甚至包括-o,-ms(取决于客户端和情况)。 Always insure your CSS has a fallback so the page will display more consistently across different browsers. 始终确保CSS具有后备功能,以便页面在不同的浏览器中更一致地显示。

I added the non-prefixed version of your animation properties to the fiddle and it appears to work just fine in firefox (I think, its harder to say because the code doesn't appear to be 100% finished). 我在小提琴中添加了动画属性的非前缀版本,它似乎在firefox中可以正常工作(我想,很难说这是因为代码似乎还没有100%完成)。

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

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