开发者

How can I disable horizontal scrolling with jquery?

开发者 https://www.devze.com 2023-03-08 03:37 出处:网络
How can I prevent horizontal scrolling with jquery? I know I know. It\'d be bet开发者_如何转开发ter to use CSS (overflow-x) but firefox has a bug that prevents me from using that :(

How can I prevent horizontal scrolling with jquery?

I know I know. It'd be bet开发者_如何转开发ter to use CSS (overflow-x) but firefox has a bug that prevents me from using that :(

EDIT:

Here's an explanation of WHY I am looking to do this.

  1. Using Firefox go here: www.simplymichele.com
  2. Play with it, navigate around, grab and swipe, etc. to familiarize yourself with how it works.
  3. With Firebug, remove the following code from the stylesheet:

.gecko #content { overflow: auto; }

This resets #content to:

overflow-x: hidden; overflow-y: auto;

  1. Now try navigating around. See how Firefox snaps back to the first slide after it scrolls to a different page (you have to click the navigation link twice to get it to stay)? This only occurs in Firefox, NO clue why. That's why I called it a FF bug. Now it could be a scrollTo plugin bug too, not sure tho.

Random note: the bottom horizontal scroll bar is hidden in firefox underneath the navigation div. To view it change #content's height with Firebug.

... now that I've explained why I need this convoluted method of controlling side-scrolling within firefox could you vote me back up to zero? Please :)


could you not use the jquery .css() function to do this?

Unfortunately I don't have access to firefox right now as I am on a mac but I use jquery a lot and it seems like you can do something like:

$('.gecko #content').css('overflow-x', 'hidden');

if this doesn't work then I don't know either...sorry

0

精彩评论

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

关注公众号