1

On responsive themes, where both sidebars and content areas collpase to 100% width,the distance between block links and their corresponding node content which come before or after all blocks is usually large. So user need to scroll down a lot to reach the desired content, which is obviously not a good user experience.

So I am wondering if there is any module/javascript/other solution to slide to the node's content whenever user clicks the link?

2

First, you need to know the ID of the Drupal region/element that you want to jump to when the responsive theme is activated. With the standard Bartik theme the id is the main content region is "block-system-main".

enter image description here

Then you could append #block-system-main to all links within your side. This will cause the browser to jump to the HTML element with that ID after clicking the link. You could append this tag to all links using javascript. See this question. It could also be done in PHP. This would be a good module and AFAIK no exists currently.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.