Scrolling to redirect to another page of one blog in a blogger

I have a blog. I want to do if someone clicks on a specific link. he must jump at a certain point on the same page. and then after a few seconds it should be automatically redirected to another page of the same blog / redirect to another blog. Please also provide an example website address. I have this code.

Script:

function jumpScroll(){ window.scroll(0,150); } 

HTML looks like this:

  <a href="javascript:jumpScroll()"> Scroll Page </a> 
+4
source share
1 answer
 function pageScroll() { window.scrollBy(0,50); // horizontal and vertical scroll increments scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds } 

To automatically scroll when the page loads, add the following code to the body tag:

 <body onLoad="pageScroll()"> 

The link is similar:

  <a href="javascript:pageScroll()">Scroll Page</a> 

Scroll straight to a specific point:

Use the scroll () method to jump to a specific point on the page. Position position is set as pixels.

 function jumpScroll() { window.scroll(0,150); // horizontal and vertical scroll targets } 

The link is similar:

  <a href="javascript:jumpScroll()">Jump to another place on the page</a> 

To go to the next page:

 function jumpScroll() { window.scroll(0,150); // horizontal and vertical scroll targets window.location.replace("http://page2.html"); } 

To go to a specific page:

you can name different functions in each link, for example:

  <a href="javascript:jumpScroll1()">jump to page1</a> <a href="javascript:jumpScroll2()">Jump to page2</a> <a href="javascript:jumpScroll3()">Jump to page3</a> 

script:

  function jumpScroll1() { window.scroll(0,150); // horizontal and vertical scroll targets window.location.replace("http://page1.html"); } function jumpScroll2() { window.scroll(0,250); // horizontal and vertical scroll targets window.location.replace("http://page2.html"); } function jumpScroll3() { window.scroll(0,350); // horizontal and vertical scroll targets window.location.replace("http://page3.html"); } 

This works great for me.

Link Link: http://www.mediacollege.com/internet/javascript/page/scroll.html

+3
source

Source: https://habr.com/ru/post/1481341/


All Articles