I am trying to use jquery to do an animated scroll from one div to another. I am halfway there but can't seem to get it to scroll on both axis. I have called the scrollto plugin and am open to using that. Here is the site live and the code: http://littleboxcreative.com/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Little Box Creative</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="jqtransformplugin/jqtransform.css" />
<link rel="stylesheet" type="text/css" href="formValidator/validationEngine.jquery.css" />
<link rel="stylesheet" type="text/css" href="demo.css" />
<script type="text/javascript" src="js/jquery.jqtransform.js"></script>
<script type="text/javascript" src="js/jquery.validationEngine.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="/js/jquery-ui.js"></script>
<script type="text/javascript" src="/js/jquery-scrollTo.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a[href*=#]').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
&& location.hostname == this.hostname) {
var $target = $(this.hash);
$target = $target.length && $target
|| $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body')
.animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});
});
</script>
</head>
<body>
<div id="main">
<div id="mainwrap1">
<div id="logo">
</div>
<div id="tagline">
<div class="tagline1">
</div>
<div id="headline">
</div>
<a href="#mainwrap2">
<div class="tagline2">
</div>
</a>
</div>
</div>
<div id="mainwrap2">
</div>
</div>
<div id="body">
<div id="services">
</div>
<div id="portfolio">
</div>
<div id="innerbody">
<div id="welove">
</div>
</div>
</div>
</body>
</html>