Diva.js 3.1.0
Changes in Diva.js 3.1.0
Changes to public methods:
- gotoPageByNumber/Index/Name all now accept two more parameters, xAnchor and yAnchor.
xAnchor may be "left", "center", "centre", or "right", and defaults to "center". Using this parameter will make the (xAnchor) part of the page line up with the (xAnchor) part of the Diva pane.
yAnchor may be "top", "center", "centre", or "bottom", and defaults to "top". This parameter functions identically to xAnchor.
- (new) getPageIndexForPageXYValues(pageX, pageY)
For a given x,y coordinate pair on the current webpage, this function will identify what page is present at that point. The function will return either the associated 0-indexed page index or "false" if no page is present at the given x,y pair.
The x,y pair should be relative to the top left corner of the browser viewport, not the diva-wrapper, diva-inner, or diva-outer objects. Given a jQuery $(window).on('click', function(e){ ... });
listener, the resulting e.pageX and e.pageY values can be used as input to this function.
No methods or parameters have been deprecated with this change.
Other notable changes:
- All settings that referred to jQuery selectors have been changed to refer to the corresponding jQuery objects.
- Diva now recognizes the "PanelSizeDidChange" Diva event, and will update the internal values that reflect the size of the Diva panel when this event is published.
- Diva now comes with a "pagealias" plugin, which allows custom page schemas for mostly cosmetic purposes. See https://github.com/DDMAL/diva.js/wiki/The-API-and-Plugins#using-the-pagealias-plugin for more details.