Mystiq_Knyght Posted June 28, 2006 Share Posted June 28, 2006 Can anybody help me, i'm not sure where I should have posted this and I apologize in advance if this is in the wrong place. Well, let me get to the point. I made up a joke survey as part of my class project and what I wanted it to do is have someone fill out the survey as if it were legit and when the user completes the survey and get ready to click submt, I want the button to move away from the mouse. I've seen these done on some jokes as an email attachment but I couldn't find any. I found a website that had the button that moves away from the mouse but I can't seem to find it's code to incorporate into my page. I'm not trying to make any money off the code and props goes out to the author(s) of the code. Can somebody please point me in the right direction? Thanks all Link to comment Share on other sites More sharing options...
justsomeguy Posted June 29, 2006 Share Posted June 29, 2006 Post a link to where you found it and we'll see what can be done. Link to comment Share on other sites More sharing options...
Jonas Posted June 29, 2006 Share Posted June 29, 2006 So you basically just want the [ Submit ] button to continually move away from the mouse? If it's not important being able to actually submit something in the end, I suppose this is a javascript issue... Link to comment Share on other sites More sharing options...
scott100 Posted June 29, 2006 Share Posted June 29, 2006 Can anybody help me, i'm not sure where I should have posted this and I apologize in advance if this is in the wrong place. Well, let me get to the point. I made up a joke survey as part of my class project and what I wanted it to do is have someone fill out the survey as if it were legit and when the user completes the survey and get ready to click submt, I want the button to move away from the mouse. I've seen these done on some jokes as an email attachment but I couldn't find any. I found a website that had the button that moves away from the mouse but I can't seem to find it's code to incorporate into my page. I'm not trying to make any money off the code and props goes out to the author(s) of the code. Can somebody please point me in the right direction? Thanks allĀ <{POST_SNAPBACK}> The easiest way would be to have 2 submit buttons a distance apart, when you mouse over one hide it and show the other, then vise versa<head><script>function toggle(val,app){document.getElementById(val).style.display=app;}</script><style>div{padding:10px;position:absolute;top:10px;}#d1{left:50px;display:block;}#d2{left:250px;display:none;}</style></head><body><div id="d1" onmouseover="toggle(this.id,'none');toggle('d2','block')"><input type="submit" value="Send" /></div><div id="d2" onmouseover="toggle(this.id,'none');toggle('d1','block')"><input type="submit" value="Send" /></div></body> Link to comment Share on other sites More sharing options...
justsomeguy Posted June 29, 2006 Share Posted June 29, 2006 There is another way I've seen where the button moves before the mouse actually gets over it. You would need a javascript callback function that gets executed every time the mouse moves (there is an event, can't remember the name, onmousemove maybe?), and it would have to check the coordinates of the mouse pointer versus the coordinates of the button. The only difficulty would be figuring out which direction to move the button to move it away from the mouse pointer.I saw this on a George Bush joke, where it asked if you voted for Bush. The No button kept moving away, and it moved just as fast as the cursor was moving, so it was never possible to be over it. Link to comment Share on other sites More sharing options...
Mystiq_Knyght Posted June 30, 2006 Author Share Posted June 30, 2006 Thanks guys for your help. The place I found the "joke" button is from a site called RJL Software (www.rjlsoftware.com) and it's called "Clickme". When it's executed you'll see the button move away from the pointer when you try to click it. Yeah, i've seen it in a number of jokes similar to the one justsomeguy had mentioned. Again, thanks all for your help, i'll keep digging around and trying all of your suggestions and hopefully i'll get it done. Link to comment Share on other sites More sharing options...
Little Goat Posted June 30, 2006 Share Posted June 30, 2006 <input type="button" id="jumper" value="clickme" onmouseover="jump()" />then in jump(): button=document.getElementById('jumper');if(button.style.left == '40'){button.style.left = '80';}else{button.style.left = '40';} of course, you can change 40 and 80 to whatever you want. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now