联想代码
zungee吧
全部回复
仅看楼主
level 6
yundsky 楼主
<!-- 首页弹半屏 -->
<div id="hot_school">
<a href="http://www.lenovo.com.cn/activity/tianyi/index.html" target="_blank" class="hot_sch_big" style="height: 400px; display: block;"></a><span class="sch_tomin">最小化</span>
<a href="http://www.lenovo.com.cn/activity/tianyi/index.html" target="_blank" class="hot_sch_small"></a><span class="sch_close" style="display: none;">关闭</span>
</div>
<script type="text/javascript">
function toSchool() {
var toMin = null;
toMin = setTimeout(function () {
$('#hot_school .hot_sch_big').animate({ 'height': '100px' }, 500, function () {
$('#hot_school .hot_sch_big').hide(0);
$('#hot_school .hot_sch_small').css('display', 'block').show(0);
$('.sch_tomin').hide(0);
$('.sch_close').show(0);
});
}, 10000);
$('#hot_school .sch_tomin').click(function () {
clearTimeout(toMin);
$('#hot_school .hot_sch_big').animate({ 'height': '100px' }, 500, function () {
$('#hot_school .hot_sch_big').hide(0);
$('#hot_school .hot_sch_small').css('display', 'block').show(0);
$('.sch_tomin').hide(0);
$('.sch_close').show(0);
});
})
$('#hot_school .sch_close').click(function () {
$('#hot_school .hot_sch_small').animate({ 'height': '0px' }, 500, function () {
$('#hot_school .hot_sch_small').hide(0);
});
})
}
$(function () {
toSchool();
//$('#hot_school .sch_close').click(function () {
// $('#hot_school .hot_sch_small').animate({ 'height': '0px' },300);
//})
})
</script>
<style type="text/css">
#hot_school {
width: 1200px;
margin: 0 auto;
position: relative;
}
#hot_school .hot_sch_big {
display: block;
width: 1200px;
height: 400px;
background: url(images/hot_sch_big.jpg);
position: relative;
overflow: hidden;
}
#hot_school .hot_sch_small {
width: 1200px;
height: 100px;
background: url(images/hot_sch_small.jpg);
position: relative;
overflow: hidden;
display: none;
}
#hot_school .sch_tomin, #hot_school .sch_close {
position: absolute;
right: 5px;
top: 5px;
display: inline-block;
width: 20px;
height: 20px;
text-indent: -9999px;
cursor: pointer;
}
#hot_school .sch_tomin {
background: url(images/sch_tomin.png);
}
#hot_school .sch_close {
background: url(images/sch_close.png);
}
</style>
<!-- 首页弹半屏 end -->
2016年05月28日 11点05分 1
1