Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery scroll to top not working
    text
    copied!<p>I have a popup that is dynamically loading content and using overflow: auto to maintain the popup size and in turn make it scrollable. I have a link at the bottom currently using anchors to scroll to the top of the div. Unfortunately it is also forcing the page to scroll down to that point as well as scroll to the top of that div.</p> <p>I am trying to prevent the page from scrolling and only scroll to the top of the div. I have tried numerous scenerios of scroll to top:</p> <pre><code>$('#id').scrollTop(0); </code></pre> <p>as well as</p> <pre><code>$('#id').animate({ scrollTop: 0 }, 'slow'); </code></pre> <p>Unfortunately this is doing nothing. I am not getting any errors. I have attempted to try it in a console and not attached to any click event and it does nothing and just prints the id to the console that I am targeting.</p> <p>Here is the link to the actual production version of this page. If you click the link for privacy policy, terms or learn more and then hit any of the back to top links you will see what the issue is.</p> <p><a href="https://carnet.vw.com/portal/en/owners/carnet?p_p_id=vwdbsappfactoryappsconnectedservicesconnectedcar_WAR_vwdbsappfactoryappsconnectedservicesconnectedcarportlet_INSTANCE_Jz5e&amp;p_p_lifecycle=0&amp;p_p_state=normal&amp;p_p_mode=view&amp;p_p_col_id=column-1&amp;p_p_col_count=1&amp;_vwdbsappfactoryappsconnectedservicesconnectedcar_WAR_vwdbsappfactoryappsconnectedservicesconnectedcarportlet_INSTANCE_Jz5e_action=view#contenttop" rel="nofollow">Here is the site</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload