如何在asp.net中使用浏览器滚动条上下移动div [英] how to move div up and down with browser scrollbar in asp.net

查看:233
本文介绍了如何在asp.net中使用浏览器滚动条上下移动div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含背景图像的div。现在问题是当我向下滚动浏览器时,包含div的页面向上移动。在这里,我希望我的页面向下移动。

i只是希望我的页面向上或向下移动根据浏览器滚动条请帮我解决这个问题我试过了



$(窗口).scroll(function(){

$(#scrollingDiv)。stop()。animate({marginTop:( $(window).scrollTop ()+ 30)+px},慢);

});





这个jQuery但是要保留。

i have a div containing background image.Now the problem is when i scrolls down the browser, the page containing div moves upward . here i want my page to move downward.
i just want my page to move upward or downward according to browsers scrollbar pls help me out with this i have tried

$(window).scroll(function(){
$("#scrollingDiv").stop().animate({ "marginTop": ($(window).scrollTop() + 30) + "px"}, "slow");
});


this jQuery but invain.

推荐答案

(窗口).scroll(function(){
(window).scroll(function(){


( #scrollingDiv)。stop()。animate({marginTop:(
("#scrollingDiv").stop().animate({ "marginTop": (


(window).scrollTop()+ 30)+px},slow);

});





这个jQuery但是重新获得。
(window).scrollTop() + 30) + "px"}, "slow");
});


this jQuery but invain.


这篇关于如何在asp.net中使用浏览器滚动条上下移动div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆