您的位置:首页 > Web前端 > CSS

page top功能以及根据屏幕宽度改变css

2012-02-23 17:12 351 查看
<!-- js部分 -->
<script type="text/javascript">//<![CDATA[
<!--{$tpl_javascript}-->
$(function(){
<!--{$tpl_onload}-->
$(document).ready( function (){
$('#pagetop').scrollFollow({
speed: 2000,
offset: 400,
container: 'container'
});
var page = document.getElementById("pagetop");
if (window.screen.width > 1280) {
page.className = "pagetopcss1";
} else {
page.className = "pagetopcss";
}
});
});
//]]>
</script>
<style type="text/css">
.pagetopcss{
margin-left:950px;
}
.pagetopcss1{
margin-left:1000px;
}
<!-- html部分 -->
<!-- MAIN --><div id="container"><!--/ランキング--></div><!-- /MAIN -->
<div id="pagetop"><a href="#header"><img src="../img/pagetop.png" alt="pagetop" width="72" height="14"></a></div>

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  function javascript html css
相关文章推荐