jsp中如何手动添加滚动条 也就是 写个纯JS的滚动条或者更好的方法实现

jsp中如何手动添加滚动条 也就是 写个纯JS的滚动条或者更好的方法实现,第1张

<script language="javascript">

$(function(){

$("#all").css({"height":"auto","width":"100%","overflow":"hidden","float":"left"})//追加样式

if($(document).height() >$(window).height()){

$("#all").css({"height":$(window).height()-35,"width":"100%","overflow":"auto","float":"left"})//追加样式

}

$(window).resize(function(){

$("#all").css({"height":"auto","width":"100%","overflow":"auto","float":"left"})//追加样式

if( $("#all").height() >= $(window).height()-35() ){

$("#all").css({"height":$(window).height()-35,"width":"100%","overflow":"auto","float":"left"})//追加样式

}else{

$("#all").css({"height":$(window).height()-35,"width":"100%","overflow":"hidden","float":"left"})//追加样式

}

})

}) 将要添加滚动条的部分用<DIV ID="all" ></div> 包含进来

</script>

//增加代码

$(document).swipeLeft(function(){

if (isAnimating) return

last.row = now.row

last.col = now.col

if (last.row>2 &&last.row<4 &&last.col==2) { now.row = last.rownow.col = 3pageMove(towards.left)}

})

$(document).swipeLeft(function(){

if (isAnimating) return

last.row = now.row

last.col = now.col

if (last.row>2 &&last.row<4 &&last.col==3) { now.row = last.rownow.col = 4pageMove(towards.left)}

})

$(document).swipeRight(function(){

if (isAnimating) return

last.row = now.row

last.col = now.col

if (last.row>2 &&last.row<4 &&last.col==4) { now.row = last.rownow.col = 3pageMove(towards.right)}

})

$(document).swipeRight(function(){

if (isAnimating) return

last.row = now.row

last.col = now.col

if (last.row>2 &&last.row<4 &&last.col==3) { now.row = last.rownow.col = 2pageMove(towards.right)}

})


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11886263.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-19
下一篇 2023-05-19

发表评论

登录后才能评论

评论列表(0条)

保存