PDA

View Full Version : Rollover problems, changing text?


mmeyboom
06-12-2007, 05:37 PM
Hi,
I know how to do the basic rollover but I was wandering is it possible to hover the mouse over an image and then for some text in the page to change (e.g. from plain to bold). Thanks for anyones help.

Mike.

Karkar
06-12-2007, 09:26 PM
You mean text completely unrelated to that image or text in the same paragraph? Cos if you used css you could have the text apart of the same class as the image...

mmeyboom
06-12-2007, 09:53 PM
yep the text is apart from the image.

Karkar
06-12-2007, 09:59 PM
hmm. Don't know to be honest. If the image and text are links you could just put them both between the same a href tags and edit the 'a' class in css. But if they're nowhere near eachother i can't tell ya what to do.

I'm sure oneof the dreamweaver gurus can!

Good luck

Cary
06-13-2007, 05:23 AM
Well, because of your question, I figured I would give it a try. Is this (http://www.solsector.com/cary/links.html) anything like what you have in mind?

Karkar
06-13-2007, 06:17 AM
exactly what's i'm talking about. Is that what you wanted to do? I'm not sure if that's the best/cleanest way to do it, but there's a thousand way to do anything. That's what I would have done if that's the effect I wanted to achieve.

It's really quite nice

Karkar
06-13-2007, 06:18 AM
but of course there is the question of not wanting to be able to select the text??

Cary
06-13-2007, 06:59 AM
Yep, I don't know how to get around that.

davidj
06-13-2007, 08:12 AM
create 2 styles (classes)

the first style is the look of the text before you mouseover. The second is what you want the text to look like when you mouseover. Assign the class1 to the div that your text is in and give the div an id

<div id="fontc">text text text text text text text text </div>

in Javascript you could write this...


function changeTex(){

a = document.getElementById('fontc');

a.className = "newclassname";

}


then on the link you could have this..


<a href="#" onmouseover="changeTex()" >link</a>

mmeyboom
06-13-2007, 08:41 AM
thanks everyone for your help, and thanks for the example Carry, just what I needed. Now I'll see if I can put all that into practice!

davidj
06-13-2007, 09:13 AM
and thanks for the example Carry


err... it was me

mmeyboom
06-13-2007, 09:16 AM
yeah sorry, thanks davidj, got it all working now!

domedia
06-13-2007, 01:11 PM
mmeyboom, make sure you take a good look at the DOM example DJ posted. If we're talking cleanness, or separation of dynamics, style and content; it's optimal.

mmeyboom
06-13-2007, 01:53 PM
Hi again!
I thought I had sorted it however it still doesn't seem to be working. I've uploaded the page which I'm trying to do it to: http://www.michielmeyboom.com/newsite/
As you can see when you hover over the words the appropriate picture becomes highlighted but I also want it so that when you hover over the picture the appropriate word is highlighted. Am I missing something really simple here? Again any help would be very much appreciated.

Cary
06-13-2007, 10:55 PM
thanks everyone for your help, and thanks for the example Cary, just what I needed. Now I'll see if I can put all that into practice!

You're welcome, but my original quick test would look pretty bad in a text browser, so I reworked it a little bit here (http://www.solsector.com/cary/links.html).

Cary
06-14-2007, 04:48 AM
Hi again!
I thought I had sorted it however it still doesn't seem to be working...


I don't know javascript, so here (http://www.solsector.com/cary/mmeyboom/)'s a non-javascript version of the section of your page in question.

The images are here (http://www.solsector.com/cary/mmeyboom/images/).

Let me know when you've looked at it and it's okay to take down.

mmeyboom
06-15-2007, 03:03 PM
thanks for that Cary, appreciate you going to all that effort!