Open ajax333221 opened 3 years ago
The document.body offsets should be limits: 1) top, 2) left, 3) left +$(document.body).innerWidth(), 4) top + $(document.body).innerHeight().
document.body
$(document.body).innerWidth()
$(document.body).innerHeight()
Something like I did in here: https://github.com/ajax333221/isepic-chess-ui/blob/e5c02bc7cbc1aa259cc84aa07a52cf985e4e5ebb/js/isepic-chess-ui.js#L133
With and some safty checks the piece could stop trying to go beyond this limits and the scroll bars should not appear.
The
document.body
offsets should be limits: 1) top, 2) left, 3) left +$(document.body).innerWidth()
, 4) top +$(document.body).innerHeight()
.Something like I did in here: https://github.com/ajax333221/isepic-chess-ui/blob/e5c02bc7cbc1aa259cc84aa07a52cf985e4e5ebb/js/isepic-chess-ui.js#L133
With and some safty checks the piece could stop trying to go beyond this limits and the scroll bars should not appear.