• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

cursor position in iframe

 
Ranch Hand
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we find the cursor position inside iframe.

please help..

thank you.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 129
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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




 
Popeye has his spinach. I have this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic