dragscroll icon indicating copy to clipboard operation
dragscroll copied to clipboard

Center mode

Open kayaz opened this issue 7 years ago • 0 comments

Hi, im making Hidden Object Game using yours script and i need help. How to setup image on start in center position? Not top left.

And how to disabe refresh page when on mobile you scroll on bottom container?

@edit This is working for me

var divWidth = document.getElementById('mydiv').offsetWidth;
var divHeight = document.getElementById('mydiv').offsetHeight;
var widthImg = 2000;
var heightImg = 666;

$('#mydiv').scrollLeft((widthImg-divWidth)/2);
$('#mydiv').scrollTop((heightImg-divHeight)/2);

kayaz avatar Jan 04 '18 02:01 kayaz