finishScorm();
});
- var currentLocation = getScormValue('location');
- try {
- if (currentLocation.indexOf('page_') === 0) {
- var e = currentPage.split('_');
- if (e.length == 2 && e[0] == 'page') {
- fluidbook.setCurrentPage(e[1]);
- }
- } else if (currentLocation.indexOf('{') === 0) {
- var location = JSON.parse(currentLocation);
- if (location.maxPage) {
- fluidbook.setMaxPage(location.maxPage, true);
- }
- if (location.page) {
- fluidbook.setCurrentPage(location.page);
+ $(fluidbook).on('fluidbook.splash.hide',function(){
+ console.log('init scorm events');
+ var currentLocation = getScormValue('location');
+ try {
+ if (currentLocation.indexOf('page_') === 0) {
+ var e = currentPage.split('_');
+ if (e.length == 2 && e[0] == 'page') {
+ fluidbook.setCurrentPage(e[1]);
+ }
+ } else if (currentLocation.indexOf('{') === 0) {
+ var location = JSON.parse(currentLocation);
+ if (location.maxPage) {
+ fluidbook.setMaxPage(location.maxPage, true);
+ }
+ if (location.page) {
+ fluidbook.setCurrentPage(location.page);
+ }
}
+ } catch (err) {
+ console.log(err);
}
- } catch (err) {
- console.log(err);
- }
+ });
$(fluidbook).on('fluidbook.page.navigation', function (e, page) {
scormSaveCurrentPosition(page);