0

I am having trouble with a website for work, when the website is in a smaller browser window it does not go to top of page automatically when a link is clicked.

There are no pages each link is a panelview, this is very frustrating as there is a mobile version of the site which does the same thing. Also in full screen mode website is fine.

Any help would be much appreciated:
http://www.website-unavailable.com/?wc=EWJvEw1mAxhfBBV3GA8H&url=synergy%2Dclinics%2Ecom

Note actual web browser not scrollbox

2 Answers2

2

Have you tried to add an event to clickable elements and have a scrollTop ?

Using jquery for example:

$(".clickable").on("click", function(){

    $('html, body').animate({
      scrollTop: 0
    }, "slow");

});

Hope this helps!

punkbit
  • 7,347
  • 10
  • 55
  • 89
0

Have you tried simply using window.scrollTo(x-coord, y-coord);

You should call this function when you open the new panelview.

With jquery you could also animate the scrolling to the top.

Daniel
  • 3,541
  • 3
  • 33
  • 46
  • Hi,there is a function in the link called menuitemclick which calls the new panels when clicked can I add it to this? there are no pages in the code.
  • Home
  • what does return false mean and do I need it? – user3652131 May 19 '14 at 10:47
  • I don't know anything about in detail about your web page - so I simply have to guess... In fact href="#" should result in a scroll to the top of the page. But if it doesn't, you could add either my line of code or the lines of heldrias answer to your MenuItemClick() function. Both should result in the same baheviour. If this still doesn't work please open a new question with more in depth details on the code (maybe with a fiddle icluded?) as this question is marked as duplicate. – Daniel May 19 '14 at 16:54