d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help With Basic Java
Add Reply New Topic New Poll
Member
Posts: 27,214
Joined: Jun 17 2009
Gold: 288.11
Mar 1 2013 12:19am
I wasnt sure whether to put this in homework or here, but i have to write code that does

Create yet another dynamic web page called "pictureComments.html" with following features:

The page contains four pictures next to each other (again, you choose the pictures).
When the page loads, a text underneath them says "Please, move the mouse over a picture.".
When the mouse is moved over an image, a short description of this image is shown instead of this request.
When the mouse is not over any of the images, the text says again "Please, move the mouse over a picture.".

javascript

This post was edited by Pratt on Mar 1 2013 12:20am
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 1 2013 12:23am
your title is very misleading. java != javascript.

you should also explain what you need help with and your current code.

im guessing it has to do with one of the mouse events (hover?)
Member
Posts: 20,715
Joined: Mar 1 2008
Gold: 82.00
Mar 1 2013 01:02am
Quote (Pratt @ Mar 1 2013 01:19am)
I wasnt sure whether to put this in homework or here, but i have to write code that does

Create yet another dynamic web page called "pictureComments.html" with following features:

The page contains four pictures next to each other (again, you choose the pictures).
When the page loads, a text underneath them says "Please, move the mouse over a picture.".
When the mouse is moved over an image, a short description of this image is shown instead of this request.
When the mouse is not over any of the images, the text says again "Please, move the mouse over a picture.".

javascript


This can't be all javascript though, am I wrong? I just had my first javascript class today, and for some reason I think that you could do most of this with html/CSS

This post was edited by jimmym007 on Mar 1 2013 01:03am
Member
Posts: 27,214
Joined: Jun 17 2009
Gold: 288.11
Mar 1 2013 03:47am
Quote (jimmym007 @ Mar 1 2013 03:02am)
This can't be all javascript though, am I wrong? I just had my first javascript class today, and for some reason I think that you could do most of this with html/CSS


i mean all the basics are HTML yes

but im not sure how to do the mouseovers and the div and stuff like that, new to programming tbh
Member
Posts: 2,478
Joined: Jan 4 2007
Gold: 7,545.00
Mar 1 2013 07:40am
As said before, this should've gone under the website section. Java is not javascript.

Anyways to help... http://lmgtfy.com/?q=javascript+mouseover

The first link will help. If you can't figure it out come back with what you're stuck on.
Member
Posts: 2,757
Joined: Nov 26 2007
Gold: 1,214.81
Mar 1 2013 11:31am
<!DOCTYPE html>
<html>
<head>
<script>
function onOver(what)
{
document.getElementById('text').innerHTML=''+what+'';
}

function onOut()
{
document.getElementById('text').innerHTML='Put your mouse over the image';
}

</script>
</head>
<body>

<!--you have to copy and paste this line for your other images. Just change the parameter of onOver to whatever text you want-->
<img onmouseover="onOver('OMG SOME TEXT LOLOLOOL')" onmouseout="onOut()" border="0" src="yourImage.png"width="32" height="32">
<div id="text">Put your mouse over the image</div>

</body>
</html>

This post was edited by labatymo on Mar 1 2013 11:36am
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll