这个炫酷图片滑动切换效果是用纯css3制作而成。插件中精美的插画来自于花瓣。
HTML
html结构分为三个部分:第一,单选按钮和label;第二,用来放置图片切片的容器div,为它定义class为cr-bgimg
;第三,还有一个divcr-titles
用来放置图片的标题。
<section class="cr-container"> <!-- radio buttons and labels --> <input id="select-img-1" name="radio-set-1" type="radio" class="cr-selector-img-1" checked/> <label for="select-img-1" class="cr-label-img-1">1</label> <input id="select-img-2" name="radio-set-1" type="radio" class="cr-selector-img-2" /> <label for="select-img-2" class="cr-label-img-2">2</label> <input id="select-img-3" name="radio-set-1" type="radio" class="cr-selector-img-3" /> <label for="select-img-3" class="cr-label-img-3">3</label> <input id="select-img-4" name="radio-set-1" type="radio" class="cr-selector-img-4" /> <label for="select-img-4" class="cr-label-img-4">4</label> <div class="clr"></div> <!-- panels --> <div class="cr-bgimg"> <div> <span>Slice 1 - Image 1</span> ... </div> <div> <span>Slice 2 - Image 1</span> ... </div> <div> <span>Slice 3 - Image 1</span> ... </div> <div> <span>Slice 4 - Image 1</span> ... </div> </div> <!-- titles --> <div class="cr-titles"> <h3> <span>Serendipity</span> <span>What you've been dreaming of</span> </h3> <h3> <span>Adventure</span> <span>Where the fun begins</span> </h3> <h3> <span>Nature</span> <span>Unforgettable eperiences</span> </h3> <h3> <span>Serenity</span> <span>When silence touches nature</span> </h3> </div> </section>