2013-05-14 56 views
0

我在this page上设置了背景转换。CSS3转换流问题

页面的第一区“伊尔博客 - 莱吉合奏GLI articoli”“GLI节庆活动 - 莱吉合奏GLI EVENTI”显示了不同岗位类型的瓷砖列表。 当悬停在其中一个上时,转换开始。 当移出鼠标时,其他转换开始。 直到那里一切都很好。

该问题显示在转换完成之前将鼠标移出瓦片时出现问题。

我想弄清楚什么是我的CSS缺少,但我找不到它。

我知道我可以解决移动到jQuery脚本的问题,但我更喜欢使用CSS方法。

这里所涉及的元素的SCSS摘录:

article { 

    @include box-shadow(0 0 2px $primary-color); 
    @include transition(all 1s ease-in-out); 
    @include border-radius(2px); 

    background-image: url('../images/concrete_wall.png'); 

    &:hover { 
     @include box-shadow(0 0 4px $primary-color); 
     background-image: url('../images/concrete_wall_2.png'); 

    } 
} 

这里的生产CSS,以防万一有人喜欢这样看问题:

body.home #posts-area #posts-area-columns #home-posts-list article, body.home #posts-area #posts-area-columns #featured-events-list article { 
    -webkit-box-shadow: 0 0 2px #222222; 
    -moz-box-shadow: 0 0 2px #222222; 
    box-shadow: 0 0 2px #222222; 
    -webkit-transition: all 1s ease-in-out; 
    -moz-transition: all 1s ease-in-out; 
    -o-transition: all 1s ease-in-out; 
    transition: all 1s ease-in-out; 
    -webkit-border-radius: 2px; 
    -moz-border-radius: 2px; 
    -ms-border-radius: 2px; 
    -o-border-radius: 2px; 
    border-radius: 2px; 
    background-image: url("../images/concrete_wall.png"); 
} 
/* line 60, ../sass/_home.scss */ 
body.home #posts-area #posts-area-columns #home-posts-list article:hover, body.home #posts-area #posts-area-columns #featured-events-list article:hover { 
    -webkit-box-shadow: 0 0 4px #222222; 
    -moz-box-shadow: 0 0 4px #222222; 
    box-shadow: 0 0 4px #222222; 
    background-image: url("../images/concrete_wall_2.png"); 
} 
+0

是不是第二次过渡1到很多?而是试试这个:'@include transition(all 1s ease-in-out);' – DiederikEEn 2013-05-14 11:19:41

+0

你可以在小提琴中添加或发布html吗? – DiederikEEn 2013-05-15 06:28:36

+0

不知道我如何才能从这部分创建一个小提琴只。 至于HTML,它在我发布的网址中。 – 2013-05-15 21:05:11

回答

0

您在包括第二过渡悬停是无用的。轻松进入,使其淡入淡出。

article { 

    @include box-shadow(0 0 2px $primary-color); 
    @include transition(all 1s ease-in-out); //Note i changed it to eas-in-out 
    @include border-radius(2px); 

    background-image: url('../images/concrete_wall.png'); 

    &:hover { 
     @include box-shadow(0 0 4px $primary-color); 
     background-image: url('../images/concrete_wall_2.png'); 
     //Note I removed the unnecessary transition 
    } 
} 
+0

你说得对:第二次过渡是无用的。但是,删除它并不能解决问题。我用生成的CSS更新我的问题。 – 2013-05-14 11:56:21

+0

你想添加eas-out-out? @AndreaSciamanna你忘了这个:'@include transition(全1s缓和); '而不是'@include transition(全部为1s);' – DiederikEEn 2013-05-14 12:04:54

+0

其实我是这么做的,就像你在实际的CSS中看到的一样(我忘记了编辑SCSS代码)。 – 2013-05-14 18:37:22