View Single Post
  #12 (permalink)  
Old 11-05-09, 12:08 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by belgirl View Post
First of all, to say "Here's a tutorial and code for creating the "corner peel" effect: http://www.marcofolio.net/webdesign/...r_website.html" is not reading my original post as I already referenced this page AND the actual code in my first post. To state that is repetitive and unnecessary.
I pointed you to the other corner peel code as an alternative, in case it would be easier for you to understand or implement. I apologize for suggesting alternate resources or code.


Quote:
Originally Posted by belgirl View Post
Secondly my original post states "ATTEMPT to hit the back button or close out the site." Not hover. My example of trafficgenerator.com shows this example.
There isn't anything that will prevent them from "attempting" to hit the Back button. If they do hit the Back button, onUnload() is likely to be all you can use. If onUnload() doesn't work with your script or page, that's another issue.



Quote:
Originally Posted by belgirl View Post
Thirdly, to state "It would be pretty easy to write your own:" is also an unnecessary comment. If it were easy or if I knew how to do it, I wouldn't be asking the question on the forum.
I'm not familiar with your level of expertise, so I can't tell how exactly much help you need. We're glad to help (or try to, in any case). We can provide examples and bits of code but generally we don't write complete scripts for people. If someone here is willing to do that for you, that's great, but typically it's going to be up to you to do at least some of the coding.


Quote:
Originally Posted by belgirl View Post
Lastly "onUnload" isn't working with this particular script and nor is the script you provided.
As mentioned above, if onUnload() doesn't work with your script or page, then there's something else going on. It's a standard Javascript function that works in any recent browser. As for the script I provided, depending on your brand of browser, it may or may not detect the mouse position, so I've pasted in another one below that should work with just about any browser (see below). If you don't understand how it works, please ask.


Quote:
Originally Posted by belgirl View Post
If you are able to further provide insight, that's fine.
Well, I'm trying.


Quote:
Originally Posted by belgirl View Post
Otherwise perhaps someone else who has programming knowledge can help.
If someone else is willing to assist you, they're welcome to.

HTML Code:
<html>
<body>
<!-- mouse coordinate display script, should work with any modern browser -->
<form name="MouseDisplay">
<input type="text" name="MouseX" value="0" size="4"> X<br>
<input type="text" name="MouseY" value="0" size="4"> Y<br>
</form>

<script type="text/javascript">
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMousePos;
// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;

function getMousePos(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch/correct negative values 
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  

  // show the position values in the form
  document.MouseDisplay.MouseX.value = tempX;
  document.MouseDisplay.MouseY.value = tempY;
  return true;
}
</script>
</body>
</html>
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]

Last edited by End User; 11-05-09 at 12:13 PM.
Reply With Quote