Missing something simple
Missing something simple
I'm trying to implement scrollTo functionality on document ready, but running into a problem (it's not scrolling... to).
However, currently i'm having an even simpler problem...
Given the following html, i expect an alert box to display the offset position, but i get 'null'.
Am I missing something?
- <html>
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="jquery.scrollTo-1.4.2.min.js"></script>
<script type="text/javascript" language="javascript">
function showResults() {
alert($('div#a').position());
}
$(document).ready(showResults());
</script>
<body>
<div id="a">
<h1>Test</h1>
</div>
</body>
</html>
Thanks