0

这里很奇怪。

滑动切换在第一次打开/关闭时正常工作。第二次,div 移出页面。

在此处查看实时示例。底部链接在角落,打开和关闭几次。

    <!-- Basket overlay -->
<div id="basketHolder">
    <div class="basketButton">
        <a href="">Your Shopping Bag</a>
    </div>
    <div class="basket">
        <p>test</p>
    </div>
</div>   

$(document).ready(function(){
  $(".basketButton").click(function(e){
      e.preventDefault();
    $(".basket").slideToggle("slow");
  });
});

/* Basket */
#basketHolder {
    position:fixed;
    bottom:25px;
    right:25px;
    padding-top:67px;
}
.basketButton{
    position:absolute; top:0; right:0;
    /*background-image:url('images/pinkbag.png');*/
    background:red;
    padding-left:60px;
    display:inline-block;
    background-repeat: no-repeat;
    height: 67px;
}

.basketButton a{
    white-space:nowrap;
    font-weight:bold;
    font-size:18px;
    color: #67062F;
    padding-top:15px;
    display:inline-block;
}

.basket{
    display:none;
    width:250px;
    height:200px;
    padding:10px;
    border-radius:5px;
    /*background-image:url('images/pink-bg.png');*/
    background:blue;
}


.basket h3{
    color:#FFF;
}
4

1 回答 1

1

改变 basketButton 类如下:

.basketButton{
    width:270px;
    position:relative; 
    text-align:right;
    /*background-image:url('images/pinkbag.png');*/
    background:red;
    display:inline-block;
    background-repeat: no-repeat;
    height: 67px;
}
于 2013-06-06T10:54:39.003 回答