tanks

获取览器显示区域的高度 : $(window).height();
获取浏览器显示区域的宽度 :$(window).width();
获取页面的文档高度 :$(document).height();
获取页面的文档宽度 :$(document).width();
获取滚动条到顶部的垂直高度 :$(document).scrollTop();
获取滚动条到左边的垂直宽度 :$(document).scrollLeft();

//监听滚动条滚动事件
  $(window).scroll( function() {
var WindowHeight=($(window).height());
var ScrollHeight=$(document).scrollTop();
if(WindowHeight<=ScrollHeight){
$(\'.top_img\').removeClass(\'displayno\');
}else{
$(\'.top_img\').addClass(\'displayno\');
}
} );
//设置锚点链接
//a1
<a href="#1F"></a>
//a2
<a href="" name="1F" id="1F">
点击a1会链接到a2的页面
在ci框架中在head中加上base_url的时候<base href=\'<?= base_url().\'h5/treasure_v2/\'?>\'>
a的href的链接地址需要改成<?= site_url(\'/treasure/treasure_view\')?>#1f(ps注意#1F书写的位置不要在>里面)





分类:

技术点:

相关文章: