I'm trying to scroll to the div that contains the results of a jquery load operation.
The ajax load works as expected but the page does not scroll after the load.
Why doesn't this test code do this? Or, is there a better way?
Here is the test page that does not scroll after the load but does scroll if you then mouse click on the anchor hash tag (Go to...):
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<div>line 1</div>
<div>line 2</div>
<a id="idGoTo" href="#scrollTo">Go to...</a>
<a name="scrollTo">SI</a>
<div id="divRightSide">
<!-- ajax content here -->
</div>
<script type="text/javascript" src="/js/jquery/jquery-1.11.3.min.js"></script>
<script>
$(document).ready(function() {
$("#divRightSide").load("/php/graduate/programs/clinical/programinformation_s.php", function() {
$("#idGoTo").trigger("click");
});
}
);
</script>
</body>
</html>
Thanks Much for any consideration