aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes cursor position in iframe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "cursor position in iframe" Watch "cursor position in iframe" New topic
Author

cursor position in iframe

ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

How can we find the cursor position inside iframe.

please help..

thank you.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
This an editable thing or you want to know the mouse coordinates? Not sure with the limited details you gave.

Eric
ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

I wanted to get the cursor position in my iFrame which is relative to the iframe walls...

Actually we use 'href' attribute in iFrame to tell the content we want in side iframe.

I specified the path to an html page... then I used the below mentioned code
and I was able to get the cursor position in any browser: (IE, Mozilla, Safari).

By the way thank you Eric for your concern..

the code:

Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
FYI:

Normally people say cursor position when they are talking about textareas and textboxes.
They say mouse position when it is the X/Y coordinates on the page.

Eric
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Your code is a little outdated in how it detects browsers. When coding JavaScript it should be sniffin support for objects,methods and properties that you are going to use.

There is a nice example here on http://www.quirksmode.org/js/events_properties.html.

Eric
ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

Thank you Eric ...

I visited the link, I got the required information.. but neither my code mentioned above nor the code help in the given link allowing cross browser compatibility...

Below I am specifying all code I am using ... It is running successfully on IE & Safari but not on Mozilla & Netscape.

Please help me to make changes to allow the desired output on all browser.

Details: I am using three files - temp1.html, tooltip.css & tooltipz.html.


temp1.html:



tooltip.css:



tooltipz.html



This entire code is running properly on IE & Safari but not on Mozilla & Netscap...
Please any buddy help me resolve the problem..

Thank you.



ramnna jain
Ranch Hand

Joined: Mar 16, 2009
Posts: 129

This is the real code..

Any buddy facing the problem to get the mouse position & successfully run on any browser(IE, Mozilla, Netscap, Safari) please use this given link:

http://www.codingforums.com/archive/index.php/t-87134.html

I want to show How I made changes in my above given code:


temp1.html:



tooltip.css:




tooltipz.html




 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cursor position in iframe