这里是我的代码:jquery显示和隐藏不工作?缺少的东西,我不能弄明白
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(".social").hover(function() {
$("h1", this).hide();
$(".networks", this).fadeIn();
}, function() {
$(".networks", this).hide();
$("h1", this).fadeIn();
});
</script>
<style>
.networks {
display:none;
}
</style>
</head>
<body>
<div class="social">
<h1>Share this</h1>
<div class="networks">
<p>Twitter</p>
<p>Facebook</p>
</div>
</div>
</body>
</html>
当我http://jsfiddle.net/ppksR/尝试,它的真正的工作,但是当我复制粘贴在我的Dreamweaver,它不工作。我错过了什么???任何帮助?
嗨@ Chacha102,我有同样的问题。我试图包裹它,它是这样的: <脚本类型= “文本/ JavaScript的”> \t \t $(函数(){ \t \t $( “社会”。)悬停(函数(){ \t。 \t $( “H1”,此).hide(); \t \t $( “网络。”,这).fadeIn(); “网络” \t \t},函数(){ \t \t $(,这个).hide(); \t \t $(“h1”,this)。淡入(); \t \t}); \t \t}); \t 但仍然没有效果... – 2013-03-04 01:03:03