<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
function goToByScroll(id){
$('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
}
</script>
</head>
<body>
<ul>
<li><a href="javascript:void(0)" onClick="goToByScroll('1')">Go to anchor 1</a></li>
<li><a href="javascript:void(0)" onClick="goToByScroll('2')">Go to anchor 2</a></li>
<li><a href="javascript:void(0)" onClick="goToByScroll('3')">Go to anchor 3</a></li>
<li><a href="javascript:void(0)" onClick="goToByScroll('4')">Go to anchor 4</a></li>
</ul>
<div style="width:600px">
<div id="1">
<h1>1</h1>
jQuery attempts to retrieve the elements specified by the
selector before calling the .live() method, which may be time-consuming on large documents.
Chaining methods is not supported.
For example, $("a").find(".offsite, .external").live( ... ); is not valid and does not work as expected.
Since all .live() events are attached
at the document element, events take the longest and slowest possible path before they are handled.
On mobile iOS (iPhone, iPad and iPod Touch)
the click event does not bubble to the document body for most elements and cannot be used with .live() without applying one of the following workarounds:
Use natively clickable elements such as
</div>
<div id="2">
<h1>2</h1>
jQuery attempts to retrieve the elements specified by the
selector before calling the .live() method, which may be time-consuming on large documents.
Chaining methods is not supported.
For example, $("a").find(".offsite, .external").live( ... ); is not valid and does not work as expected.
Since all .live() events are attached
at the document element, events take the longest and slowest possible path before they are handled.
On mobile iOS (iPhone, iPad and iPod Touch)
the click event does not bubble to the document body for most elements and cannot be used with .live() without applying one of the following workarounds:
Use natively clickable elements such as
</div>
<div id="3">
<h1>3</h1>
jQuery attempts to retrieve the elements specified by the
selector before calling the .live() method, which may be time-consuming on large documents.
Chaining methods is not supported.
For example, $("a").find(".offsite, .external").live( ... ); is not valid and does not work as expected.
Since all .live() events are attached
at the document element, events take the longest and slowest possible path before they are handled.
On mobile iOS (iPhone, iPad and iPod Touch)
the click event does not bubble to the document body for most elements and cannot be used with .live() without applying one of the following workarounds:
Use natively clickable elements such as
</div>
<div id="4">
<h1>4</h1>
jQuery attempts to retrieve the elements specified by the
selector before calling the .live() method, which may be time-consuming on large documents.
Chaining methods is not supported.
For example, $("a").find(".offsite, .external").live( ... ); is not valid and does not work as expected.
Since all .live() events are attached
at the document element, events take the longest and slowest possible path before they are handled.
On mobile iOS (iPhone, iPad and iPod Touch)
the click event does not bubble to the document body for most elements and cannot be used with .live() without applying one of the following workarounds:
Use natively clickable elements such as
</div>
</div>
</body>
</html>