jquery - 一旦悬停,如何阻止无序列表跳转?

标签 jquery html css

在我工作的公司的时间表内,我确实在努力解决另一个问题,非常感谢您的帮助。一切都按需要工作,我遇到的唯一问题是列表项在悬停时不断跳跃。我已经尝试了我在我的 css 中所知道的一切,从固定的高度和宽度到各种位置,即。固定的、相对的和绝对的似乎都不起作用。我知道这个时间表之前已经过,我感谢所有以前的帮助,但这是不同的。

JSFIDDLE http://jsfiddle.net/Jason1975/9tskrf9q/11/

CSS

* {
            margin: 0;
            padding: 0;
        }

        body {
            background: #ffffff;
            font-family: 'open sans', sans serif, arial;
            font-weight: lighter;
            color: #808080;
            font-size: 14px;
        }
        /* Type */
        h1,h2,h4,h5,h6 {
            text-align: center;
            color: #ccc;
            margin-bottom: 5px;
        }
            h1 {
                font-size: 18px;
            }
            h2 {
                font-size: 14px;
            }
            .section-title, .portfolio-title {
            text-align: center;
            font-size: 36px;
            font-weight: 100;
            text-transform: lowercase;
            margin: 0;
        }
        a   { font-size: 14px; text-decoration: none; color: #666666; }
        a:hover { font-size: 14px; color: #F47C00;  }
        /* Timeline */
        #master {   width: 989px;
                    height: auto;
                    margin: 0 auto; 
        }
        #container {    position: relative;
                        width: 100%;
                        height: 80px;
                        margin: 0 auto;
                        overflow: hidden;
                        white-space:nowrap;
                        background:url(http://www.valueportfolio.co.za/jsfiddle/line.png) center 50% repeat-x;
        }
        ul#new {  display: inline; 
                  position: relative;
                  width: 100%;
                  left: 0;
                  top: 0
        }



        .block-up   {   position: relative;
                        display: inline-block;
                        list-style:none;
                        width: 130px;
                        height: 80px!important;
                        margin: 0!important;
                        top: 0;
                        background: url(http://www.valueportfolio.co.za/jsfiddle/dot.png) center 50% no-repeat;

        }
        .block-down {   position: relative;
                        display: inline-block;
                        list-style:none;
                        width:130px;
                        height: 80px!important;
                        margin: 0!important;
                        top: 0;
                        background: url(http://www.valueportfolio.co.za/jsfiddle/dot.png) center 50% no-repeat;

        }
        .block-down a   { font-size: 14px; }
        .block-down a:hover { font-size: 14px; }
        .date-up {      padding-bottom: 20px;
                        text-align:center;
        }
        .event-up {     padding-top: 20px;
                        text-align: center;
                        font-size: 14px;
                        color: #F47C00;
                        visibility: hidden;


        }
        .date-down {    padding-top: 20px;
                        text-align:center;


        }
        .event-down {   padding-bottom: 20px;
                        text-align: center;
                        font-size: 14px;
                        color: #F47C00;
                        visibility:hidden;


        }
        #grad_left,
                #grad_right {
                    width: 100px;
                    height: 350px;
                    position: absolute;
                    top: 0;
                }
                    #grad_left {
                        left: 0;
                        background: url('http://www.valueportfolio.co.za/jsfiddle/left-grad.png') repeat-y;
                    }
                    #grad_right {
                        right: 0;
                        background: url('http://www.valueportfolio.co.za/jsfiddle/right-grad.png') repeat-y;
                    }

                #next,
                #prev {
                    position: absolute;
                    top: 0;
                    font-size: 24px;
                    width: 24px;
                    height: 47px;
                    background-position: 0 0;
                    background-repeat: no-repeat;
                    text-indent: -9999px;
                    overflow: hidden;
                }
        #next, #prev {
            top: 15px;
        }

                    #next {
                        right: 0;
                        background-image: url('http://www.valueportfolio.co.za/jsfiddle/right.png');
                    }
                    #prev {
                        left: 0;
                        background-image: url('http://www.valueportfolio.co.za/jsfiddle/left.png');
                    }
                        #next.disabled,
                        #prev.disabled {
                            opacity: 0.2;
                        }               

最佳答案

只需添加

vertical-align:top;

到你的.block-up

更新fiddle

关于jquery - 一旦悬停,如何阻止无序列表跳转?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28187945/

相关文章:

javascript - 如何使用 block 级元素作为背景

javascript - 重新打开时出现空 Fancybox v2 登录对话框

javascript - 切换两个隐藏单选按钮的最佳方法是什么?

javascript - 在 ReactJS 呈现的内容中延迟加载图像、视频和 iframe

javascript - onclick 属性与 eventListeners

"not A and not B"的 CSS3 选择器?

javascript - jQuery 单击事件在切换侧边栏时仅起作用一次

javascript - 动态添加颜色到添加的文本

html - 如何在 Oracle SQL*Plus HTML 报告中指定 HTML 文档类型?

Javascript:两个元素之间的垂直间距