Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Center mode #37

Open
kayaz opened this issue Jan 4, 2018 · 0 comments
Open

Center mode #37

kayaz opened this issue Jan 4, 2018 · 0 comments

Comments

@kayaz
Copy link

kayaz commented Jan 4, 2018

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant