Jump to content
Search Community

Need to track mouse even outside banner iframe region > possible?

fripi test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Hi,

 

the title says a lot already, a client wants to move an element in the banner in function with the mouse position in the page, not only when the cursor hovers the banner.

 

In horizontal formats it just follow the X-axis and in vertical formats the Y-axis.

 

I found some codepens and adapted one that uses easelJS but as soon as we go out of the iframe region it isn't followed anymore, is there a possibility to track it as long as the cursor stays in the browser?

 

See the Pen eJrJGy by anon (@anon) on CodePen

Link to comment
Share on other sites

I've personally never really tried, but I'd imagine that the browser won't allow that sort of thing due to security concerns. It'd be a bit scary if code inside iframes could "watch" my mouse outside of their context. Maybe if both are from the same domain and the security restrictions are properly appeased. 

  • Like 3
Link to comment
Share on other sites

If you could hear the mouse activity anywhere on a page your banner happens to be on, the dimensions of your banner would have to be 100%, rathert than 728x90.

 

This is definitely something that falls under rich media. Perhaps reach out to Doubleclick Studio Rich Media and ask if they have done anything like that. There are templates in their template database that were created for specific unusual requests.

  • Like 1
Link to comment
Share on other sites

Theoretically it is possible but only with full cooperation from the site and the ad platform. What would happen is the site/ad platform would implement the tack on the document/window level and make that available to you via their API. 

 

But I do find it hard to be something already in place. Like what somnamblst said, reach out for the ad platform who'll be serving it and see what they offer. Because, straight vanilla JS is not going to help you here due to security reasons. An iFrame is like, a little world on its own. It needs special permissions before it can talk to other iFrames or pages.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Just to inform those who are interested:

Doubleclick is working on a new asset to create some paralax effect that follows the mouse position in the page, and not only in the banner. But it's still in beta and if you want to play with it as soon as they are ready you need the studio certification.

  • Like 3
Link to comment
Share on other sites

  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...