I want to add the following jquery in external javascript file.
$("a[href='#c4']").click(function() {
$("html, body").animate({ scrollTop: 0 }, 2500);
return false;
});
});
How to execute this in html file?.Help me...
I want to add the following jquery in external javascript file.
$("a[href='#c4']").click(function() {
$("html, body").animate({ scrollTop: 0 }, 2500);
return false;
});
});
How to execute this in html file?.Help me...
First include jquery file in your html and then just include your external file after your jquery file in your html page like this:
<head>
<script src="your_jquery_file.js"></script>
<script src="yourexternalfile.js"></script>
</head>
exactly the way i did in my answer<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>Hello World</h1>
<script type="text/javascript" src="path/to/jquery.js"></script>
<script type="text/javascript" src="path/to/your/jsFile.js"></script>
</body>
</html>