0

I'm creating a game in a web page and I think it will be better, if when the user accidentally click back (in tablet or phone) then will appear a confirm box to stay.

I would like to use an own style confirm box (with more options) instead of the original. Well, now I use onbeforeunload JavaScript Event. Although I can't change the style, I can add more things to do when it happens. So I think if it can be hidden, then it's enough for me :D

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Speederman
  • 61
  • 1
  • 8
  • 1
    It is not possible (apply styles or create a custom modal for confirmation in `onbeforeunload`). – Protomen Feb 06 '15 at 21:11
  • 1
    This has been asked before. See http://stackoverflow.com/a/276739/2337565 – Ding Feb 06 '15 at 21:13
  • Ok, I can't change that, but is it possible to rewrite this event to don't show any confirm box and don't go back? Just stay here and call my function? – Speederman Feb 06 '15 at 21:35

0 Answers0