/    Sign up×
Community /Pin to ProfileBookmark

Hi,

I’m having some trouble with scrollbars and loading pages.

When the user clicks on buttons, content loads into another div, using javascript/iframes to call separate html files. That all works fine. But if you scroll down the loaded content, and then click another link, the new content loaded will be partially scrolled down already, and I would like it to load at the TOP!
I have tried a few solutions to no avail:

  • 1. In the html files that are called when the user clicks the links, I have tried [CODE]<body onLoad=”window.scrollTo(0,0)[/CODE]

  • 2. In the calling javascript (the link you click) I have tried adding an anchor:
    [CODE]<a href=”javascript:loadSource(‘right’,null,’mandatorypreworkshopinfo.html#top’)”>[/CODE]
    and added the [CODE]<a name=”top”></a> [/CODE]to the top of the html file being called. That has no effect either.[/CODE]
  • I have spent hours on this already. Please help if you can ?

    Thanks.
    -Rick

    to post a comment
    JavaScript

    0Be the first to comment 😎

    ×

    Success!

    Help @aricknophobia 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.5,
    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: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

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

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...