Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Lionsanime Directory   Perfect Money   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 03-05-2004, 02:57 PM   #1 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
Text to appear somewhere on rollover

I want some text to appear in another area on the site when you roll over an image. How would I do this?

I want it similar to when you hover over the buttons on http://www.classic63lincoln.com/ but with text appearing not images

I also want to still be able to keep rollover image capabilities as well


If you don't understand what I'm asking I will try and explain it again.
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 03-05-2004, 03:16 PM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
javascript.... ive seen it before

onHover="javscript:changeImage();"
or something.. never used javascript though sorry I cant helpy any further
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-05-2004, 03:17 PM   #3 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
That will only do a normal rollover as far as I know though. Basically I want an onmouseover code but this then makes some text appear in another place on the page.
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-05-2004, 03:57 PM   #4 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
you gotta have it call a javscript script.. and have that image originally display with it

so like where you want the image you have
<img src="javascript:getImage()"> or something..
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-05-2004, 11:59 PM   #5 (permalink)
Inactive
 
Join Date: 10-13-03
Posts: 275
iTrader: 0 / 0%
Latest Blog:
None

Distorted is on the right pathDistorted is on the right path
He doesn't want an image to appear. He wants to make text appear somewhere when you mouseover something.

I'm sure that LazyJim has the answer at the top of his head.

I don't however, but I can suggest that you go to a site like javascriptsource.com or dynamicdrive.com where I'm sure that you'll find something useful.
Distorted is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 12:57 AM   #6 (permalink)
v7n Mentor
 
hatchet's Avatar
 
Join Date: 10-11-03
Posts: 1,137
iTrader: 0 / 0%
Latest Blog:
None

hatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nicehatchet is just really nice
[code:1:101ac1d6c7]<script>
var content=new Array()
//change the array below to the text associated with your links Expand or contract the array, depending on how many links you have
content[0]='Any content you want here - with html tags'
content[1]='Ditto'


function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
appear()
setTimeout("window.onresize=regenerate",450)
}
}

function changetext(whichcontent){

if (document.all||document.getElementById){
cross_el=document.getElementById? document.getElementById("descriptions"):document.a ll.descriptions
cross_el.innerHTML='<font face="Verdana"><small>'+whichcontent+'<font></small>'
}
else if (document.layers){
document.d1.document.d2.document.write('<font face="Verdana"><small>'+whichcontent+'</small></font>')
document.d1.document.d2.document.close()
}

}

function appear(){
document.d1.visibility='show'
}

window.onload=regenerate2


//-->
</script>[/code:1:101ac1d6c7]

Then call it with this..
[code:1:101ac1d6c7]onmouseover="changetext(content[0]); return true;"[/code:1:101ac1d6c7]
in your link code.
hatchet is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 01:09 AM   #7 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
OK I tried this and got the error 'cross_el' is a null object. Also would this make it so that when I hover over an image I get text somewhere else? It looks from my basic javascript knowledge that this would just make text appear on rollover.
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 03:39 AM   #8 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
It's not too much of a problem, but the onmouseover event needs to do two things, one solution is to make it call a single function that calls two others:
[code:1:ae3dad24d0]
<script>
function doHoverText(oImg) {
// text changing code here
}

function doHoverImage(oImg) {
// image mouseover code here
}

function doMouseOver(oImg) {
doHoverText(oImg);
doHoverImage(oImg);
}
</script>
<img src="image.gif" onmouseover="doMouseOver(this)" onmouseout="doMouseOut(this)">[/code:1:ae3dad24d0]

Of course I havn't defiend the functions for onmosueout in that script but you get the idea.
I'll bet you need help with the code missing inside the functions now?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 03:52 AM   #9 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
yeah, I think I do
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 04:26 AM   #10 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
lol
ok which one first?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 04:42 AM   #11 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
the one for the text appearing somewhere else
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 04:47 AM   #12 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
Depends on if you want to store the text in JavaScript, in a hidden HTML layer, or a hidden <input> value?

Plus I gotta go, back later sorry!
(many scripts out there already).
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 04:56 AM   #13 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
I think I'll store it in the Javascript unless activating a hidden layer is easier.
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 07:34 AM   #14 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
well hide/show layer is easier - but not so good when people don't have CSS enabled browsers.

In JavaScript it gets annoying if it has HTML (including <br>) or quotes (" or ') in it, and also the longer the text is the more effort it is for coding

So we can do it in JavaScript if you want.
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 07:40 AM   #15 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
Quote:
Originally Posted by LazyJim
well hide/show layer is easier - but not so good when people don't have CSS enabled browsers.

In JavaScript it gets annoying if it has HTML (including <br>) or quotes (" or ') in it, and also the longer the text is the more effort it is for coding

So we can do it in JavaScript if you want.
I think I'll go with the hide/show layer thing. It is quite a bit of text that I want to display and without css the site will probably look terrible anyway.
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 08:27 AM   #16 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
Now find the element (tag) that contains the whole changing part, and duplicate it in position how ever many tiems you need, (and change the text on each copy to whatever it should be).

Give each copy an id: id="changing_layer_1", id="changing_layer_2", id="changing_layer_3"...
Then give them all style="display: none; speak: none;"
... You don't have to use numbers, give them any ID you want just as long as u remember what's what!
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 08:30 AM   #17 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice
OK done that. Does this have to be done to a div tag or can it be done to a td tag as well.
edbarton is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 08:33 AM   #18 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
no do it to a <div>, it's the safest option, and anything with tables is unsafe due to the way browsers handle them.
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 08:54 AM   #19 (permalink)
Moderator
 
LazyJim's Avatar
 
Join Date: 10-13-03
Location: UK
Posts: 2,819
iTrader: 0 / 0%
Latest Blog:
None

LazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to allLazyJim is a name known to all
Send a message via MSN to LazyJim
Ok I've changed my mind on a small thing!
Take out the style="display: none; speak: none;" and instead put in class="hidden_layer";

Then set up a style sheet that hides/shows layer that have the right class...
[code:1:641c766e0e]<style>
div.hidden_layer {
display: none;
speak: none;
}
div.visible_layer {
display: block;
speak: normal; /* EDIT: I changed this line after I posted the script */
}
/* You could add more things to hide the layers in old or wierd browsers! Like height: 0px; and visibility: hidden; */
</style>[/code:1:641c766e0e]

And this is the text changing function:
[code:1:641c766e0e]function doHoverText(sID) {
// hide some layers and show the one we want...
// sID is the ID of the layer we want to show.
// If no ID given, bail out:
if (!sID) return;
// Get a reference to the actuall layer:
var oLayer = document.getElementById(sID);
// But bail out if the layer was not found:
if (!oLayer || oLayer=='undefined') return;
// Hide ALL of the layers:
document.getElementById('changing_layer_1').class = "hidden_layer";
document.getElementById('changing_layer_2').class = "hidden_layer";
document.getElementById('changing_layer_3').class = "hidden_layer";
// ...etc. (Note we did not check if the exist, so make sure you don't do a typo, and that the layers ARE there!)
// Then show the layer we want:
oLayer.class = "visible_layer";
}
[/code:1:641c766e0e]

All untested
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
LazyJim is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-06-2004, 08:55 AM   #20 (permalink)
Inactive
 
edbarton's Avatar
 
Join Date: 10-13-03
Location: England
Posts: 2,781
iTrader: 0 / 0%
Latest Blog:
None

edbarton is just really niceedbarton is just really niceedbarton is just really niceedbarton is just really nice