0

D2L - Brightspace

In a content page, when you insert a Quicklink to any course material (discussion boards, dropbox, quiz, etc. excluding URL's) with a "same window" target (target="_self"), the page reloads with the same height as the parent page. Which, depending on the length of the page, the user has to scroll up to see the page content.

With jQuery, which element/class should I target to get the window to scroll to the top of the new linked page?

So far I have: when a link with a _self target is clicked scroll to top of ... I've tried window, body, iframe, then I started targeting class names but with no luck.

$(document).ready(function(){
    $("a[target='_self']").click(function(){
        $(".d2l-page-main").scrollTop(0);
    });
});

Is anyone else experiencing this and could anyone shed some light on how I could resolve this issue? Thank you!!

1 Answers1

0

According to the jQuery documentation for .scrollTop(value), the method sets the scrollbar for a set of elements. This doesn't seem to be what you're trying to do. Assuming that you want to put a certain element at the top of the page, this may help.