0

I'm using colorbox to show a login form for every new visitor. And I have disabled all options to close the overlay:

overlayClose: false,
escKey: false,
onLoad: function() {
    $('#cboxClose').remove();
}

... but I assume even an intermediate user can simply hide the overlay using CSS overrides. I'd like to know if there's anything I could do in that case? Use setInterval and do the checks every few seconds and redirect if changes found or something?

4

2 回答 2

0

How about you just do not give them the content? That is the only way to really secure the page.

You would need to check visibility, z-index, top, left, indents, that the node is there, etc. There is a whole list of ways to remove the content off the screen.

But most people who do checks like this will use an interval and check that the element is there and either move it back or redirect. There is sites that do it and I wrote code that disables their scripts that do the checks. :)

于 2013-05-08T13:25:36.680 回答
0
  • Check if the element is within the viewport (many plugins available)
  • Check display, visibility, z-index, opacity and width, height
  • If the check fails empty the page and location.reload();
  • Use tags to redirect if javascript is disabled.
于 2013-05-08T19:43:09.487 回答