DDMAL / diva.js

:books: IIIF-compatible document image viewer
http://ddmal.github.io/diva.js
Other
252 stars 40 forks source link

URL parameter for upper-left location #256

Open AFFogarty opened 9 years ago

AFFogarty commented 9 years ago

Right now, you can specify x and y location by ?x=123&y=456 in the page URL and Diva will automatically open to that location. x and y are calculated as offsets from the centre of the page.

It would be nice if you could give ?ulx=123&uly=456 parameters to open at (123,456) from the top-left of the page.

ahwitz commented 9 years ago

For what it's worth https://github.com/DDMAL/diva.js/blob/master/source/js/diva.js#L2527 takes "top" and "left" as parameters. Should be relatively easy to hook something of that pattern into setState.