Skip to content
Snippets Groups Projects
Commit 02ad5eb9 authored by Lijunxian Zhang's avatar Lijunxian Zhang :star:
Browse files

scorllmagic bug fixes

parent 4e47f6a8
No related branches found
No related tags found
No related merge requests found
......@@ -78,10 +78,18 @@ new ScrollMagic.Scene({
.addTo(controller);
//######
controller = controller.destroy(true);
pinScene = pinScene.destroy(true);
refresh();
//use Deferred to listen img loading.
$imgs.each(function() {
var dfd = $.Deferred();
$(this).load(dfd.resolve);
defereds.push(dfd);
});
$.when.apply(null, defereds).done(function() {
controller = controller.destroy(true);
pinScene = pinScene.destroy(true);
refresh();
});
function refresh() {
document.documentElement.style.setProperty('--subpageImgWidth', $('.subpage-img').width()+'px');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment