PDA

View Full Version : onMouseover .....



Echo54321
29-03-2008, 06:06 PM
Ya, Everyone knows the On Mouseover image scripts where theres like a man on a bike you put your cursor over it, And it changes to a woman or something, Like on the habbo buttons

But its is possible with Divs?

Like <div id="button_off">Home</div>

But on MouseOver

<div id="button_on">Home</div>

And on MouseOut back to:

<div id="button_off">Home</div>

++++Rep Ty :)

Gangster
29-03-2008, 06:10 PM
Ermmm... could i see a preview of what your trying to do?

kk.
29-03-2008, 06:11 PM
yes there is.

duplicate the div in the CSS and add :hover to one of them and change some stuff

Echo54321
29-03-2008, 06:15 PM
Hmm

So like

#button {
background-image: url (images/button.png)


Then what!?, How do i set the background of the div to change when hovered

Like...

background-image:hover: (images/button2.png) ?

kk.
29-03-2008, 06:17 PM
#button:hover {
background-image: url (images/buttonhover.png);
}

Echo54321
29-03-2008, 06:21 PM
Yes But...

So

<div id="button">Hi</div>

thats all i need and #button:hover will also relate to that?

kk.
29-03-2008, 06:23 PM
yes .
try it and if it doesnt work, show me a link

and your sig should be sign, not sing, (unless its meant to be lol)

Echo54321
29-03-2008, 06:25 PM
Lol i know!

#button {

background-color: #EAF7FB;

width: 20px;

float: center;

margin-right: 90px;

text-align: left;

margin-top: 0px;

font-size: 10px;

font-face: Verdana;

font-weight: bold;

font-decoration: None;

font-color: Black;

border-style: solid;

border-color: #000000;

border-width: 1px;

}
#button:hover {

background-color: #ffffff;

width: 90px;

float: center;

margin-right: 90px;

text-align: left;

margin-top: 0px;

font-size: 10px;

font-face: Verdana;

font-weight: bold;

font-decoration: None;

font-color: Black;

border-style: solid;

border-color: #000000;

border-width: 1px;

}



I tried that, But i hover over and nothing!

kk.
29-03-2008, 06:28 PM
hmm, do you have a link. it may be playing up because of the widths

Echo54321
29-03-2008, 06:31 PM
No its currently passworded

Isn't there a way of like using the image script and then replace the Images with Divs?

Echo54321
29-03-2008, 06:33 PM
<div id="button1" onmouseover="button2" >

summot like tht

kk.
29-03-2008, 06:35 PM
i dont know why it hasnt worked :S

and unfortunately, i dont know of any other ways sorry.

Echo54321
29-03-2008, 06:38 PM
Ok...

Thank You anyway

Gangster
29-03-2008, 06:39 PM
http://www.habboxforum.com/showthread.php?t=464406

i think you mean this.

kk.
29-03-2008, 06:41 PM
weve already done that :)

link to show my method: click (http://www.cheatssource.co.uk/showcase/Codeetech/)

Echo54321
29-03-2008, 06:48 PM
#button {

background-color: #FF0000;

}
#button:hover {
background-color: #000000;

}


still the button is red, and on hover nothing

kk.
29-03-2008, 06:49 PM
can you not get rid of the password protect? otherwise we just wont know
or upload somewhere else

Echo54321
29-03-2008, 06:50 PM
:/, I'll tell you what i'll make another file with it on

do you want built in CSS or external?

kk.
29-03-2008, 06:53 PM
any, it doesnt really matter, just make sure we can view the website and the css

Echo54321
29-03-2008, 06:54 PM
HabboLIFE.co.uk/x

kk.
29-03-2008, 07:00 PM
just a suggestion, but the code you gave me is not valid anyway. btry adding head tags, proper style code if you havnt already


<html>
<head>
<style type="text/css">
<!--
#button {
background-color: #FF0000;
}
#button:hover {
background-color: #000000;
}
-->
</style>
</head>

<body>
<div id="button">Button!</div>
</body>
</html>

Echo54321
29-03-2008, 07:01 PM
Done that, Still nothing...

Could Windows server be anything to do with it ? cos i know some scripts dont work properly on windows

kk.
29-03-2008, 07:06 PM
no its not that. I ahve no idea why yours is not working.
have you tried just that code and tested it? if not, try it. It may be your computer or browser

Echo54321
29-03-2008, 07:26 PM
well it dosent work for you either

kk.
29-03-2008, 07:29 PM
erm when did i say that?

link (http://cheatssource.co.uk/x.html)

Echo54321
29-03-2008, 07:29 PM
What teh hell!¬

I've just looked in Firefox and it works! but not in IE!


So it works in your site

And on mine only in FF!

?


Can you tell me what it is for when you click

like button:click?

--ss--
29-03-2008, 07:58 PM
http://www.htmldog.com/articles/suckerfish/focus/

That script works on IE, Normal ones such as basic onmouseover /onfocus / :hover won't work ;).

kk.
29-03-2008, 08:01 PM
:hover doesn't work in ie? It does for me lol

--ss--
29-03-2008, 08:04 PM
:hover doesn't work in ie? It does for me lol
Well not on divs :P

kk.
29-03-2008, 08:06 PM
go on ie and go to http://www.cheatssource.co.uk/showcase/Codeetech/

Echo54321
29-03-2008, 08:58 PM
Can someone tell me how to make it change on click too

Like when you click it turns different for a coupl of seconds?

Blazz
30-03-2008, 02:53 PM
a:active {
color: #000000;
text-decoration: none;
}

is the CSS code.
(edit the #000000 to what colour you like)

L?KE
30-03-2008, 10:45 PM
I'm no javascript coder, but I'm sure i've seen ' this.src= ' on a hover image before before.

So could you not do:

<div style="background:red;" onmouseover="this.style='background:blue;'" onmouseout="this.style='background:red;'"></div>

:) I tried anyway.. :P

Want to hide these adverts? Register an account for free!