New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
[solved] Javascript question (scroll)
I'm making a image that if you click it, will scroll a div (with overflow hidden), but it makes weird results, scrolling weird:
function scroll() { var div = document.getElementById('bio'); div.scrollTop = div.scrollTop + '1'; }
seems right, isnt it?
Comments
UPDATE: Weird, scroll up works as intented:
`function scrolldown() {
var div = document.getElementById('bio');
div.scrollTop = div.scrollTop + '1';
}
function scrollup() {
var div = document.getElementById('bio');
div.scrollTop = div.scrollTop - '1';
}`
UPDATE: removing the single quotes, '1' works. Solved.