JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Browser window Mouse Cursor Position


About
This is a javascript function that will return the current cursor position on the browser window. This java script can be used in any html page.


Features
a) This javascript function will return current mouse cursor position in the browser window.
b) We use two functions to get the result. The function init() is used to initialize event handler and capture mouse events in IE (Internet Explorer) and Mozilla (netscape)
c) Function getXY() gets the x and y axis values on cursor position in the browser window size.
d) Just copy the code in to your page and enjoy the effect.

Preview


Code
Code:
<!--        Script by hscripts.com          -->
<!--        copyright of HIOX INDIA         -->
<!-- more scripts @ http://www.hscripts.com -->
<script type="text/javascript">
window.onload = init;
function init() {
  if (window.Event) {
    document.captureEvents(Event.MOUSEMOVE);
  }
  document.onmousemove = getXY;
}

function getXY(e) {
  x = (window.Event) ? e.pageX : event.clientX;
  y = (window.Event) ? e.pageY : event.clientY;

  document.ee.sd.value = x+":"+y;
}
</script>
<!-- Script by hscripts.com -->

Release Date - 18-07-2005
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
a) Copy the javascript code into <head> tag of your page.
b) Create the HTML with the same form fields.
    <form name=ee>
    <input name=sd type=text>
    </form>
c) The function getXY(e) will be invoked whenever there is a change in cursor positioning.
d) Add your code under the comment to fit your requirement.

Related Links
Know how to create simple cursor effects using css




License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting