所有这些都是新手,并试图让我的 .js 脚本在 Coda2 中工作。如果有人知道为什么 .js 脚本文件没有响应,那就太好了!
提前致谢!
<!DOCTYPE html>
<html>
<head>
<title>Button Magic</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css' />
<script type= 'text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'></script>
<script type= 'text/javascript' src='script.js'></script>
</head>
<body>
<div><br/><strong>Click Me!</strong></div>
</body>
在脚本中:
$(document).ready(function() {
$('div').mouseenter(function() {
$('div').fadeTo('fast',1);
});
$('div').mouseleave(function(){
$('div').fadeTo('fast',0.5);
});
});
请在此处找到我的代码的图像:
最佳答案
您还没有添加脚本标签来包含 jQuery。
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js' type='text/javascript'></script>
关于javascript - .js 脚本没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16032882/