|
|
Line 993: |
Line 993: |
| e.preventDefault(); | | e.preventDefault(); |
| | | |
− | $(function () {
| + | </script><script src="https://static.igem.org/mediawiki/2017/6/60/Scrollspy.txt"></script> |
− | $('[data-spy="scroll"]').each(function () {
| + | |
− | var $spy = $(this)
| + | |
− | $spy.scrollspy($spy.data())
| + | |
− | })
| + | |
− | })
| + | |
| $("body").scrollspy({target: "#myScrollspy", offset:100}); | | $("body").scrollspy({target: "#myScrollspy", offset:100}); |
| | | |
Revision as of 23:34, 30 October 2017
$("body").scrollspy({target: "#myScrollspy", offset:100});
var target = $(this).attr("href");
}else{
var target = location.hash;
}
$('html,body').animate(
{
scrollTop: $(target).offset().top
},2000,function()
{
location.hash = target;
});
}
$('html, body').hide();
$(document).ready(function()
{
$('a[href^="#snav"]').bind("click", jump);
if (location.hash){
setTimeout(function(){
$('html, body').scrollTop(0).show();
jump();
}, 0);
}else{
$('html, body').show();
}
});