CSS3下的圆形遮罩效果手机应用实例页面

展示

回到相关文章 »

代码

CSS代码:
.trans {
    /*transition*/
    -webkit-transition: 0.3s ease;
    -moz-transition: 0.3s ease;
    -ms-transition: 0.3s ease;
    -o-transition: 0.3s ease;
    transition: 0.3s ease;
}
.test_outer {
    width: 320px;
    height: 480px;
    margin: 1em auto;
    position: relative;
    overflow: hidden;
}
.test_cover {
    width: 60px;
    height: 60px;
    border: 480px solid rgba(0, 0, 0, .45);
    border-radius: 50%;
    position: absolute;
}

.test_cover_pos1 {
    left: -227px;
    top: -478px;
}
.test_cover_pos1:after {
    content: '☺首先选择您所在的城市';
    margin: 16px 0 0 -140px;
}

.test_cover_pos2 {
    left: -447px;
    top: -378px;
}
.test_cover_pos2:after {
    width: 140px;
    content: '☺全新推图订餐服务,给你不一样的体验!';
    margin: 16px 0 0 60px;
}

.test_cover_pos3 {
    left: -337px;
    top: -48px;
}
.test_cover_pos3:after {
    content: '☺随时拨打订餐!';
    margin: -20px 0 0 -20px;
    white-space: nowrap;
}

.test_cover_pos1:after, .test_cover_pos2:after, .test_cover_pos3:after {
    color: #fff;
    font-family: '微软雅黑';
    text-shadow: 1px 1px rgba(0,0,0,.35);
    position: absolute;
}
            
HTML代码:
<div class="test_outer">
    <span id="testCover" class="test_cover test_cover_pos1 trans"></span>
    <img src="/study/image/radius_cover_wap_bg.png" width="320" height="480" border="0" />
</div>
            
JS代码:
(function(stepIndex) {
    var objStep = document.getElementById("testCover");
    var funStep = function() {
        objStep.className = objStep.className.replace(/\d/, (stepIndex + 1));
        stepIndex++;
        if (stepIndex > 2) {
            stepIndex = 0;
        }
        setTimeout(funStep, 3000);
    };
    setTimeout(funStep, 3000);
})(1);