Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion

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.

[solved] Javascript question (scroll)

netomxnetomx Moderator, Veteran
edited November 2012 in General

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

  • netomxnetomx Moderator, Veteran

    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';
    }`

  • netomxnetomx Moderator, Veteran

    UPDATE: removing the single quotes, '1' works. Solved.

Sign In or Register to comment.