2013-12-16 45 views
1

我需要使用純css3圖像滑塊,而不是使用任何jQuery。我只是想這純css3圖像滑塊

#content-slider { 
    font-family: arial; 
    width: 640px; 
    margin: 0 auto; 
    margin-top: 10px; 
} 

#content { 
    overflow: hidden; 
    width: 640px; 
    height: 480px; 
    -webkit-box-shadow: 0px 0px 50px 10px #c9c9c9; 
    -moz-box-shadow: 0px 0px 50px 10px #c9c9c9; 
    box-shadow: 0px 0px 50px 10px #c9c9c9; 
} 

#content-inner { 
    width:10000px; 
    height: 480px; 
} 

.page { 
    width: 640px; 
    height: 480px; 
    float: left; 
} 

.page-info { 
    height: 90px; 
    background-color: rgba(99, 99, 99, 0.6); 
    position: relative; 
    margin-top: 0px; 
    bottom: 103px; 
    color: #dedede; 
    padding-left: 20px; 
    padding-top: 10px; 
} 

.page-info h2 { 
    font-size: 21px; 
    margin-bottom: 10px; 
    margin-top: 0px; 
    color: #fafafa; 
} 

.page-text { 
    font-size: 15px; 
} 

.button { 
    float: left; 
    background: #bababa; 
    width: 16px; 
    height: 16px; 
    -webkit-border-radius: 8px; 
    -moz-border-radius: 8px; 
    border-radius: 8px; 
    margin-top:10px; 
    margin-left: 5px; 
    margin-right: 5px; 
} 

.button:hover { 
    -webkit-box-shadow: inset 0px 0px 2px 2px #d4d4d4; 
    -moz-box-shadow: inset 0px 0px 2px 2px #d4d4d4; 
    box-shadow: inset 0px 0px 2px 2px #d4d4d4; 
} 

.button:active { 
    -webkit-box-shadow: inset 0px 0px 2px 2px #7a7a7a; 
    -moz-box-shadow: inset 0px 0px 2px 2px #7a7a7a; 
    box-shadow: inset 0px 0px 2px 2px #7a7a7a; 
} 

.button a { 
    display: block; 
    width: 16px; 
    height: 16px; 
} 

#content-inner-1:target #content-inner { 
    -webkit-transition: all 400ms ease; 
    -moz-transition: all 400ms ease; 
    -o-transition: all 400ms ease; 
    transition: all 400ms ease; 
    margin-left: 0px; 
} 

#content-inner-2:target #content-inner { 
    -webkit-transition: all 400ms ease; 
    -moz-transition: all 400ms ease; 
    -o-transition: all 400ms ease; 
    transition: all 400ms ease; 
    margin-left: -640px; 
} 

#content-inner-3:target #content-inner { 
    -webkit-transition: all 400ms ease; 
    -moz-transition: all 400ms ease; 
    -o-transition: all 400ms ease; 
    transition: all 400ms ease; 
    margin-left: -1280px; 
} 

#content-inner-4:target #content-inner { 
    -webkit-transition: all 400ms ease; 
    -moz-transition: all 400ms ease; 
    -o-transition: all 400ms ease; 
    transition: all 400ms ease; 
    margin-left: -1920px; 
} 

#content-inner-5:target #content-inner { 
    -webkit-transition: all 400ms ease; 
    -moz-transition: all 400ms ease; 
    -o-transition: all 400ms ease; 
    transition: all 400ms ease; 
    margin-left: -2560px; 
} 

#content-inner-6:target #content-inner { 
    -webkit-transition: all 400ms ease; 
    -moz-transition: all 400ms ease; 
    -o-transition: all 400ms ease; 
    transition: all 400ms ease; 
    margin-left: -3200px; 
} 

,但它必須點擊(請查看我的jsfiddle this)。我想從this網站中自動從右向左滑動。有人能幫助我嗎?

對不起我的英文不好。謝謝。

+1

不想收你的問題作爲一個可能的重複,你曾經嘗試自己一個滑塊,但如果你想看看純CSS3滑塊,比在這裏你去 - HTTP:/ /stackoverflow.com/questions/18863967/infinite-image-slider-with-pure-css3/18864411#18864411 –

+0

嘿感謝您的回覆,但它沒有解決我的問題。只有兩個圖像,而不是從右向左滑動。我想從右向左自動滑動。你可以幫我嗎?謝謝 – NPE

回答