-1

I'm trying to put #TyBio into the box called #descriptblock when I hover over the image called #TyPhoto. I looked at several examples where people did something similar to this, but for some reason the text will not show when I hover. Thanks in advance!

Javascript

$(document).ready(function() {
$("#TyPhoto").hover(function(){
    $("#TyBio").show();
},function () {
    $("#TyBio").hide();

});

});

CSS

#descriptblock {
z-index:5;
width:1150px;
height:100px;
top:270px;
left:0px;
position:absolute;
background:white;
text-align:left;
display:block;
}

    #TyBio{
    display:none;
}

HTML

<html>
<head>
<link rel="stylesheet" href="https://googledrive.com/host/0B4nfVqlTfnTzQ0V5NlQydy0xU00" type="text/css" />
</head>
<body>
<div id="navcontainer">
<ul id="navlist">
<li><img id="TyPhoto" src="https://googledrive.com/host/0B4nfVqlTfnTzWDVMRzBEd1RwX2s" width="204" height="272" /></li>
<li><img src="https://googledrive.com/host/0B4nfVqlTfnTzU0pTYWVwRXZ0Tjg" width="208" height="286" /></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
<span id="descriptblock">
<div id="TyBio">TESTTHISBIOTEST!</div>
</span>
</ul>
</div>
</body>
</html>
4

2 回答 2

1

您的 HTML 不包含您的 JavaScript 或它所依赖的 jQuery 库。

<script src="jquery.js"></script>
<script src="your.js"></script>

如果我添加它们,那么它可以工作

于 2013-07-06T06:38:40.410 回答
0

您包含了 2 个版本的 jquery 库文件。

http://2013.igem.org/Team:Georgia_State/teamgallery.html

查看源代码,第 71 行 (v1.4.2) 和第 132 行(v1.9.1)。

于 2013-07-06T06:51:45.910 回答