design & fixes
This commit is contained in:
@@ -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');
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user