this are the snippets and I need them to put in one common file. The idea is to have one extern .js file with all these snippets I tried to copy all the code in one file but it does not work. Is it possible to have more then one $(document).ready(function ?
<!-- Java Script //-->
<script type="text/javascript">
$(".collapse").collapse()
$('#menu').collapse({
toggle: false
})
</script> <!-- end of navigation -->
<script type="text/javascript">
var jump=function(e)
{
//prevent the "normal" behaviour which would be a "hard" jump
e.preventDefault();
//Get the target
var target = $(this).attr("href");
//perform animated scrolling
$('html,body').animate(
{
//get top-position of target-element and set it as scroll target
scrollTop: $(target).offset().top
//scrolldelay:1 seconds
},1000,function()
{
//attach the hash (#jumptarget) to the pageurl
location.hash = target;
});
}
$(document).ready(function()
{
//$('a[href*=#]').bind("click", jump);
$('a[href*=#]').not(document.getElementsByClassName("carousel-control")).bind("click", jump);
return false;
});
</script> <!-- // end of smooth scrolling -->
<!-- // Shows menu after 50px -->
<script type="text/javascript">
var fixed = false;
$(document).scroll(function() {
if( $(this).scrollTop() > 25 ) {
if( !fixed ) {
fixed = true;
$('#navigation').css({position:'fixed', display:'inline'});
}
} else {
if( fixed ) {
fixed = false;
$('#navigation').css({position:'relative', display:'block'});
}
}
});
</script>
Could you writte me how I am gonna do that? Thanks in advance.