|
|
|
|
![]() ![]() |
Mar 21 2006, 12:02 AM
Post
#1
|
|
|
Member [ Level 2 ] Group: Members Posts: 53 Joined: 20-March 06 Member No.: 12,139 |
stun ur visitor with a new bg image on every mouse click of his!
easy code to dynamically change the background image. Notice from szupie:
QUOTE control the background image using the links on your site. control the color using onMouseOver, onMouseOut, onClick, and a combination of all of them. place the code below between the and tags within the HTML page where you want the link to appear. edit the link text provided to point at the page you would like to open. Option 1: use this to change the background color when user places mouse over the link. CODE <a href="link.htm" onMouseOver="document.body.background='red.gif'">Link Text</a> Option 2: use this to change the background image when user removes mouse from over the link (onMouseOut). CODE <a href="link.htm" onMouseOut="document.body.background='green.gif'">Link Text</a> Option 3: use this to change the background image when user clicks the link (onClick). CODE <a href="link.htm" onClick="document.body.background='blue.gif'">Link Text</a> Option 4: use this to change the background image twice, once when the user places the mouse over the link then again when the user takes the mouse off the link (onMouseOver and onMouseOut). CODE <a href="link.htm" onMouseOver="document.body.background='red.gif'" onMouseOut="document.body.background='green.gif'">Link Text</a> Option 5: use this to change the background image three times, once when the user places the mouse over the link, again when the user takes the mouse off the link, and again when the user clicks on the link (onMouseOver, onMouseOut, and onClick). CODE <a href="link.htm" onMouseOver="document.body.background='red.gif'" onMouseOut="document.body.background='green.gif'" onClick="document.body.background='blue.gif'">Link Text</a> njoy! shiv |
|
|
|
Mar 21 2006, 10:05 PM
Post
#2
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 12 Joined: 16-February 06 Member No.: 11,335 |
It is nice, but is there any other applicable uses to this other than to irritate your users with crazy, inconsistent, and confusing backgrounds?
|
|
|
|
Dec 13 2007, 09:41 PM
Post
#3
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
If it could change the background image of a DIV, I can see a use for it. Anyone have any code for that?
-Lance |
|
|
|
Jun 27 2008, 08:31 AM
Post
#4
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Wouldn\\
Dynamically Change The Background Image On Mouse Effects! I'm useless at javascript, but wouldn't it be something like OnClick="this.Style.Background='red.Gif'" But after trying that, it didn't work :P anyone have a quick solution to changing a style element directly through an 'on' command without having to use your own functions? I'm currently trying to make a 'pushed-look' to my CSS buttons using onClick. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 22nd August 2008 - 12:45 AM |