tags:

views:

46

answers:

3

Script adds id for block, gives:

<div id="some">Text</div>

After that page should jump for that id, without animation, just like we have target #some on current page link.

How to do this?

Thanks.

+2  A: 

Like this:

location.href = "#some"; 
SLaks
+5  A: 

Try this:

 document.getElementById('some').scrollIntoView(true);
unomi
+1 because I've never heard of this before! Surprised it works cross browser, despite not being part of the spec. http://www.quirksmode.org/dom/w3c_cssom.html#t23
Andrew
+3  A: 

Do you just mean linking "old school" like #some

For example

<a href="#some"></a>

Done in JS with

location.href = "#some"; 
Pez Cuckow