Scroll to the Google Books Preview when it loads user/dbs/scroll_to_preview
authorDan Scott <dscott@laurentian.ca>
Mon, 25 Feb 2013 19:51:11 +0000 (14:51 -0500)
committerDan Scott <dscott@laurentian.ca>
Mon, 25 Feb 2013 19:51:11 +0000 (14:51 -0500)
On screens with large fonts or not much vertical resolution or with lots
of copies to display, clicking the "Google Books Preview" button
wouldn't result in a very noticeable change to the page because the
major change was buried under the fold.

Therefore, use the ID of the preview pane to scroll to that location
after the preview gets loaded.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/ac_google_books.tt2

index 8243fe0..30aa3f7 100644 (file)
@@ -65,6 +65,7 @@ function GBPViewerLoadCallback() {
   GBPViewer.load('ISBN:' + GBisbns[0]);
   GBPViewer.resize();
   dojo.byId('gbpbadge').style.display = 'none';
+  document.location.hash = '#rdetail_preview_div';
 }
 
 dojo.addOnLoad(function() {