I wat to make the button move on mouseover

B

Bill Thomason

I have a simple question. I know i've seen the code before but am unable to
find it.
when a user trys to click on a button i want it to move away from them. i
want to play a joke on one of our users. been hitting the button before
they're done.
don't remember if it was onmouseover or when focused.

Thanks,
Bill
 
R

Roy Schestowitz

Bill said:
I have a simple question. I know i've seen the code before but am unable
to find it.
when a user trys to click on a button i want it to move away from them. i
want to play a joke on one of our users. been hitting the button before
they're done.
don't remember if it was onmouseover or when focused.

Thanks,
Bill

See the CSS buttons in:

http://www.schestowitz.com/proj.htm

Change the values to make the movement greater as I don't think there is a
limit. Microsoft played a similar joke which only affects Firefox (see the
first 2 screenshots):

http://schestowitz.com/Weblog/archives/2005/03/23/ie_ban/

Hope it helps,

Roy
 
B

Bill Thomason

found it. thanks for your help.
for anybody else that might want to use it.
here is the code i was sent. I modified it for what i wanted to do and
worked like a charm. koodos to Chris
Bill

<!-- TWO STEPS TO INSTALL SHY BUTTON:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var flag = 1;
function t() {
if(flag == 1) {
N.style.top = "75px";
N.style.left = "700px";
}
if(flag == 2) {
N.style.top = "115px";
N.style.left = "100px";
}
if(flag == 3) {
N.style.top = "300px";
N.style.left = "350px";
}
flag = flag + 1;
if(flag == 4) {
flag = 1;
}
}
function al() {
alert("Correct!");
}
// End -->
</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
Is the JavaScript Source the best place to find JavaScripts?
</center>
<DIV ID="N" STYLE="position:absolute; left:350px; top:300px; width:50px;
height:50px;">
<form>
<input type=button value="NO" onMouseover="t()">
</form>
</DIV>
<DIV ID="Y" STYLE="position:absolute; left:300px; top:300px; width:50px;
height:50px;">
<form>
<input type=button value="YES" onClick="al()">
</form>
</DIV>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top