11va17bene
12-27-2010, 05:32 AM
Hello,
Well I'm another one of those new people who is not a javascript person. I have scoured the threads and have tried to implement everything I could find but it is still NOT working. I have a one page portfolio website and I want the person to click the link and it jumps down to the div containing that link. I don't know if divs need to be in the same wrapper because I have different widths for everything. Here is what I have, any help is greatly appreciated. Below is the code in the head and the navigation in the body.
<head>
<style type="text/css">
<link href="style.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='jquery-1.4.3.min.js'></script>
<script type='text/javascript' src='js/jquery.scrollTo-min.js'></script>
<script type='text/javascript'>jQuery(function( $ ){
//borrowed from jQuery easing plugin
//http://gsgd.co.uk/sandbox/jquery.easing.php
$.scrollTo.defaults.axis = 'xy';
$.easing.elasout = function(x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};
});</script>
</head>
<body>
<div id="navcontainer">
<ul id="navlist">
<a href="#" onclick="$.scrollTo( '#about', 8000, {easing:'elasout'} );">about</a>
<a href="#" onclick="$.scrollTo( '#work', 8000, {easing:'elasout'} );">work</a>
<a href="#" onclick="$.scrollTo( '#services', 8000, {easing:'elasout'} );">services</a>
<a href="#" onclick="$.scrollTo( '#contact', 8000, {easing:'elasout'} );">contact</a>
</ul>
</div>
</body>
Well I'm another one of those new people who is not a javascript person. I have scoured the threads and have tried to implement everything I could find but it is still NOT working. I have a one page portfolio website and I want the person to click the link and it jumps down to the div containing that link. I don't know if divs need to be in the same wrapper because I have different widths for everything. Here is what I have, any help is greatly appreciated. Below is the code in the head and the navigation in the body.
<head>
<style type="text/css">
<link href="style.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='jquery-1.4.3.min.js'></script>
<script type='text/javascript' src='js/jquery.scrollTo-min.js'></script>
<script type='text/javascript'>jQuery(function( $ ){
//borrowed from jQuery easing plugin
//http://gsgd.co.uk/sandbox/jquery.easing.php
$.scrollTo.defaults.axis = 'xy';
$.easing.elasout = function(x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};
});</script>
</head>
<body>
<div id="navcontainer">
<ul id="navlist">
<a href="#" onclick="$.scrollTo( '#about', 8000, {easing:'elasout'} );">about</a>
<a href="#" onclick="$.scrollTo( '#work', 8000, {easing:'elasout'} );">work</a>
<a href="#" onclick="$.scrollTo( '#services', 8000, {easing:'elasout'} );">services</a>
<a href="#" onclick="$.scrollTo( '#contact', 8000, {easing:'elasout'} );">contact</a>
</ul>
</div>
</body>