Scrolling in JavaScript/Jquery :
Scroll Lock in Any Control :
It will Lock at particular Position of Window.
<script>
$(document).ready(function () {
$(window).scroll(function scroll() {
window.scrollTo(0, 200);
});
});
</script>
or $(window).on();
In C# Source Code put this One :
ScriptManager.RegisterStartupScript(Page, GetType(), "scroll", "<script> $(document).ready(function () { $(window).scroll(function scroll() { window.scrollTo(0, 200); }); });</script>", false);
Scroll UNLock in Any Control :
$(window).off('scroll');
In C# Source Code put this One :
ScriptManager.RegisterStartupScript(Page, GetType(), "scroll", "<script> $(document).ready(function () { $(window).off('scroll'); });</script>", false);
No comments:
Post a Comment