【发布时间】:2014-01-13 23:04:41
【问题描述】:
这是我要调用的 HTML 文档:
<html>
<head>
<script type='text/javascript' src='menuTest.js'></script>
<title>Menu Test</title>
</head>
<body>
<div id="hover" style="height:80px; width:150px; background-color:black; margin-left:100px; margin-top:100px"></div>
<p id="show">this will appear</p>
</body>
</html>
这是我试图链接的 jQuery 脚本,最初试图让某些东西出现在悬停时,然后尝试放置一个 html 对象以查看它是否正确链接(它不是):
$(document).ready(function(){
$('div').mouseover(function(){
$('p').show();
$('div').mouseleave(function(){
$('p').hide();
$('div').after("<p>Hooo</p>");
});
});
我知道我错过了一些愚蠢的东西,但我查看了其他 jQuery 示例,但仍然没有弄明白。
谢谢!
【问题讨论】:
-
你应该包含 jQuery
标签: javascript jquery html css