design & fixes

This commit is contained in:
www
2020-08-30 17:39:15 +00:00
parent 58c22cd3c8
commit 79754877e5
14 changed files with 31661 additions and 96 deletions

View File

@@ -9,6 +9,30 @@ $(
link = target.src ? target.parentNode : target,
options = { index: link, event: event },
links = this.getElementsByTagName('a')
blueimp.Gallery(links, options)
}
options['onslide']=function(index,slide) {
console.log(index)
console.log($(`#links a:nth-child(${index})`).attr('id'))
history.replaceState(null,null,'#'+$(`#links a:nth-child(${index+1})`).attr('id'))
}
options['onclose']=function(){
history.pushState(null,null,'#')
}
blueimp.gallery=blueimp.Gallery(links, options)
}
window.onpopstate = function(){
console.log(`popped state ${$(location).attr('hash')}`)
if($(location).attr('hash')=="") {
blueimp.gallery.close()
}else {
$($(location).attr('hash')).trigger('click');
}
}
console.log($(location).attr('hash').substr(1))
$($(location).attr('hash')).trigger('click');
})