开发者

jQuery ScrollTo / serialScroll accessibility for non-JavaScript user

I have successfully implemented Ariel Flesler's ScrollTo and serialScroll plug-in (http://plugins.jquery.com/project/ScrollTo) for a vertical scroll, overflow:hidden div. Here, the normal scrollbar does not appear, and instead the user clicks on buttons i have created which implement a gradual, eased scroll with Flesler's scripts. However, my problem is that I would like the scrollbar to appear - only for users who don't have JavaScript enabled, so that they can still scroll down and see all the content in that div without being able to use my manually implemented scrollers.

I have searched low and h开发者_开发技巧igh for an answer so this is my last resort really. Thanks!


You'll want to ensure the div has overflow:auto set initially in your CSS, then have Javascript change it to overflow:hidden later on.

This way, Javascript-disabled users will see the scrollbars, and Javascript-enabled users will not.

<script type="text/javascript">
    $(document).ready(function(){
        // change yourDiv to whatever selector is needed
        $(yourDiv).css("overflow","hidden");
    });
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜