/    Sign up×
Community /Pin to ProfileBookmark

Table scroll escaping

I have a table with a fixed height and overflow set to auto so a vertical scroll bar appears. But when you scroll to the bottom of the table it starts scrolling the entire page. How can I prevent this when the mouse is inside the table?

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@arc4nisOct 26.2008 — As far as I know there is no way to prevent this with HTML/CSS, but I think you can do this with javascript, you would have to make an event that happens lets say every 0.1 sec, I'm sorry but I dont have the time to write a working javascript code so maybe this pseudocode may help you:

var position=0;

function eventevery0.1sec()

{

if (the mouse is inside the table)

{

set scrollbar_position=position;

position=scrollbar_position;

}

}

but still if you manage to write a script like this it wont work on all browsers (thats the problem with messing around with the scrollbars).

So you need to ask yourself, do you really need to do this or can your webpage work without this?
Copy linkTweet thisAlerts:
@kurentauthorOct 27.2008 — It can work without this, but the user will often scroll to the bottom and drag the entire page with him. :mad:
×

Success!

Help @kurent spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...