dtttlua7165 2019-04-05 00:42
浏览 138

CSS过渡使Safari可以向上滚动到顶部

Sorry for my bad english, i'm coding a webpage using JS and CSS, i'm using css grid to do the layout, i have a div with many buttons with hover transitions for shadow and to increase the size of the button.

When i scroll in that container to see other text box and i hover on any button and the transition starts, the div scrolls back to the top.

This only happens in Safari, in Chrome it works.

I've tried to disable the transitions and the issue is fixed I've tried to set the container position to absolute (despite it no longer belongs to the grid and breaks all the layout) and it fixs the problem

[.ContenedorPrincipal
{
    display              : grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows   : 50px auto 22px;
    height               : 100vh;
    grid-column-gap      : 10px;
    grid-row-gap         : 1%;
    min-width            : 780px;
    min-height           : 480px;
}

.BarraSuperior
{
    grid-column-start: 1;
    grid-column-end  : 5;
    background       : rgba(0, 0, 0, 0.5);
    color            : white;
    padding-left     : 10px;
    padding-right    : 10px;
    display          : flex;
    justify-content  : space-between;
    overflow         : hidden;
    flex-wrap        : wrap;
    padding          : 5px;
  z-index: 10;


}

.Escenario
{
    grid-column-start: 1;
    grid-column-end  : 4;
    background       : rgba(255, 255, 255, 1);
    margin-left      : 10px;
    min-height       : 400px;
    min-width        : 400px;


}

.MenuAsignacion
{
    grid-column-start: 4;
    grid-column-end  : 5;
    min-width        : 350px;
    max-width        : 350px;
    margin-right     : 10px;
    background       : rgba(224, 224, 224, 1);
    overflow         : hidden;
    overflow-y       : auto;
    white-space      : nowrap;
    padding          : 10px;
    display          : flex;
    flex-direction   : column;
  z-index: 8;

  -webkit-transition: all 1s ease-out;
  -moz-transition   : all 1s ease-out;
  -o-transition     : all 1s ease-out;
  transition        : all 1s ease-out;

}

.scrollMenuAsignacion
{
  overflow: hidden;
}

.BarraInferior
{
  max-height: 22px;
    grid-column-start: 1;
    grid-column-end  : 5;
    background       : rgba(0, 0, 0, 0.5);
    color            : white;
    padding-left     : 10px;
    padding-right    : 10px;
    display          : flex;
    flex-wrap        : wrap;
    justify-content  : space-between;
    cursor           : default;
}][1]

I expect that it would work like in Chrome

Here's an image https://i.stack.imgur.com/T8FOe.gif

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?
    • ¥100 求三轴之间相互配合画圆以及直线的算法
    • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
    • ¥15 名为“Product”的列已属于此 DataTable
    • ¥15 安卓adb backup备份应用数据失败