English 中文(简体)
我如何利用 h来促使案文在使用 Java本的不同编目中发生变化?
原标题:How can I use hovering to prompt a change of text in a different div using JavaScript?

因此,我有这个网页,在左边有光彩灯。 理想的情况是,取而代之,应改变右面(它确实如此)的景象,但也应当改变ath底下盒子中的案文。 利用

在该论坛的法典中,一切都做了适当的工作,即使我改变了一切名称。 然而,当我把它放在食堂所需桌旁时,这似乎已经打破。 案文从未改变我确定的缺省。 我试图改变头盔中的实际文字,以回应个体干.的变换,但似乎也没有做这项工作。

Am I 正确使用文件。 我认为,唯一可以认为的是,改变文字打破了文字,或者说,把 Java的成像放在与产出文字箱不同的一片中,我对此表示不满意。 你们中是否有任何人向我指出了正确的方向?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>Single Mouseover</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
    var dogtext= The domestic dog (Canis lupus familiaris), is a subspecies of the gray         wolf (Canis lupus), a member of the Canidae family of the mammilian order Carnivora. 
    var cattext= The domestic cat (Felis catus or Felis silvestris catus) is a small,  usually furry, domesticated, carnivorous mammal. 
    var parrottext= Parrots, also known as psittacines are birds of the roughly 372 species in 86 genera that make up the order Psittaciformes, found in most tropical and subtropical regions. 
    var lizardtext= Lizards are a widespread group of squamate reptiles, with more than 5600 species , ranging across all continents except Antarctica as well as most oceanic island chains. 
    var horsetext= The horse (Equus ferus caballus) is one of two extant subspecies of Equus ferus, or the wild horse. 
    var chickentext= The chicken (Gallus gallus domesticus) is a domesticated fowl, a subspecies of the Red Junglefowl. 
    function writetext(){
        document.getElementById( p1 ).innerHTML=dogtext;
        document.getElementById( p2 ).innerHTML=cattext;
        document.getElementById( p3 ).innerHTML=parrottext;
        document.getElementById( p4 ).innerHTML=lizardtext;
        document.getElementById( p5 ).innerHTML=horsetext;
        document.getElementById( p6 ).innerHTML=chickentext;
    }
</script>
<link href="TextSwapTestCSS.css" rel="stylesheet">

</head>

<body>
<td width="1000" rowspan="3">
<div id="gallery">
<ul>
    <div id="p1" onmouseover="writetext(dogtext)" ><li><a href="dog.jpg"><img src="dog.jpg" width="100" height="75" alt="dog">
        <span><img src="dog.jpg" width="400" height="300" alt="dog"><br>This is a cool looking dog.</span></a></div>
    </li>
    <li><div id="p2" onmouseover="writetext(cattext)" ><a href="cat.jpg"><img src="cat.jpg" width="100" height="75" alt="cat">
        <span><img src="cat.jpg" width="400" height="300" alt="cat"><br>Just a cute kitten.</span></a></div>
    </li>
    <li><div id="p3" onmouseover="writetext(parrottext)" ><a href="parrot.jpg"><img src="parrot.jpg" width="100" height="75" alt="parrot">
        <span><img src="parrot.jpg" width="400" height="300" alt="parrot"><br>A rainbow parrot just hanging out.</span></a></div>
    </li>
    <li><div id="p4" onmouseover="writetext(lizardtext)" ><a href="lizard.jpg"><img src="lizard.jpg" width="100" height="75" alt="lizard">
        <span><img src="lizard.jpg" width="400" height="300" alt="lizard"><br>A green lizard just chillin .</span></a></div>
    </li>
    <li><div id="p5" onmouseover="writetext(horseext)" ><a href="horse.jpg"><img src="horse.jpg" width="100" height="75" alt="horse">
        <span><img src="horse.jpg" width="400" height="300" alt="horse"><br>A horse running through a field.</span></a></div>
    </li>
    <li><div id="p6" onmouseover="writetext(chickentext)" ><a href="chicken.jpg"><img src="chicken.jpg" width="100" height="75" alt="chicken">
        <span><img src="chicken.jpg" width="400" height="300" alt="chicken"><br>A chicken in an alley.</span></a></div>
</ul>
<div id="textarea" style="height:250px;width:220px;font:16px;font:16px/26px Arial, Helvetica, sans-serif;overflow:scroll; position:relative;
top:300px; left:-230px;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi pulvinar lectus non lectus auctor egestas. Donec at nunc neque. Morbi ornare condimentum lobortis. Nam vehicula urna ac mauris pharetra rutrum. Duis et arcu eget sapien interdum porttitor ut et tortor. Maecenas ultricies dignissim pretium. Integer quis enim metus. Sed enim lacus, eleifend eu euismod volutpat, blandit eu sem. Vestibulum varius purus ut est accumsan pellentesque. Donec quis enim id lectus sollicitudin suscipit at volutpat augue. Curabitur et metus purus. Fusce luctus nunc vitae sapien pharetra id accumsan lectus malesuada.</div>
</div>
</td>
</body>
</html>

<!--HERE BEGINS THE CSS TO MAKE THE GALLERY WORK-->

#gallery {position: relative; }
#gallery ul {list-style-type: none;
    width: 300px; }
#gallery li { display: inline; 
     float: left;
     padding: 10px; }
#gallery img {border-style: solid: 10px; border-color: #333; }
#gallery a { text-decoration: none;
             font-style: none;  
             color: #333; }
#gallery span {display: none; }
#gallery a:hover span {display: block;     
    position: absolute;
    top: 10px;
    left: 300px; 
    text-align: center; }
最佳回答

The following has invalid syntax: Your div should be opened inside your li tag.

<div id="p1" onmouseover="writetext(dogtext)" ><li><a href="dog.jpg"><img src="dog.jpg" width="100" height="75" alt="dog">
    <span><img src="dog.jpg" width="400" height="300" alt="dog"><br>This is a cool looking dog.</span></a></div>
</li>

页: 1

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签