Onmouseover

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jezternz
    New Member
    • Jan 2008
    • 145

    Onmouseover

    This is related to my previous question, however I feel it had nothing todo with "onblur in firefox" so I thought it best to start a new topic.

    Ok, basicly I want an event to fire everytime the user moves the mouse at all.
    I currently have:
    Code:
    	window.addEventListener?
    	 document.addEventListener('mousemove',handler,false)
    	  :document.attachEvent('onmousemove',handler);
    Which is all very well, except one problem. I have an iframe in my document. As soon as you scroll over the iframe. it stops processing the onmousemove.
    Is there anyway around this? or do I need to find another way?

    thanks, Josh
  • clain
    New Member
    • Feb 2007
    • 79

    #2
    hard task....!!! even the iframe is inside your main page body.... so this mouse event will trigger even if its on your iframe....

    post the actual requirement so that we can help you better

    Comment

    • Rsmastermind
      New Member
      • Sep 2008
      • 93

      #3
      The iframe is one of the child window of the window where you bind that Listner so it will not work in that case.

      The browser treat an ifrme as a separate window.So please think about this.Then you will sure find the solution to this case.

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Make a transparent div over the iframe, if you don't need to click inside the iframe.
        Or try to reach the body tag of the iframe through the DOM.

        Comment

        • Jezternz
          New Member
          • Jan 2008
          • 145

          #5
          yeh I ended up working with the transparent div, it worked well, thanks hsriat

          Comment

          Working...