Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRyan Barrett
31 PointsHow do I add a popup when the user moves their cursor out of the window?
Hello there,
I'm looking to add a popup which shows up when the user moves their cursor out of the website's window. I have tried to implement code from tutorials on Google to no avail, I am wondering if it is my code which is impacting it?
Would anyone be able to have a look at my code and come up with a simple popup modal?
Thanks! Ryan Barrett.
1 Answer
Steven Parker
231,271 PointsYour code seems to rely on a JavaScript modal library package that doesn't seem to included (or maybe it's just my unfamiliarity with "pastebin"). But it should be relatively easy to attach a "mouseout" event listener to the window to trigger your modal.
What do the tutorials say to do?
Ryan Barrett
31 PointsRyan Barrett
31 PointsGot it all fixed, realised I had forgotten to add it in haha! Cheers :)