I'm teaching myself JS and html, so I think it might be a good idea to write a personal page. However, when I try to run my html file which includes a JS file, JS won't work. This is the head part where I included the JS file:
<head>
<link type='text/css' rel='stylesheet' href='css/main.css'/>
<script type='text/javascript' src='js/main.js'></script>
<title>Honeydukes</title>
</head>
I put all css files under a "css" folder and all js files are under a "js"folder. index.html is outside in the root directory. My js file looks like this:
$(document).ready(function() {
$('#map').mouseenter(function() {
$(this).animate({
height: '+=20px',
width: '+=20px'
});
});
$('#map').mouseleave(function() {
$(this).animate({
height: '-=20px',
width: '-=20px'
});
});
});
Am I missing something here? Can someone please take a look and enlighten me? Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…