adde body fade-in + restore scroll position (needs tweaking for actual loading times)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
18c32a3781
commit
8546deafbf
@ -10,13 +10,42 @@
|
|||||||
<script src="grid-n-view.js"></script>
|
<script src="grid-n-view.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
/* fade-in body... */
|
||||||
|
body {
|
||||||
|
animation: fadeInAnimation ease 1s;
|
||||||
|
animation-iteration-count: 1;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fadeInAnimation {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
// save/restore scroll position...
|
||||||
|
window.onbeforeunload = function(){
|
||||||
|
window.scrollX > 0 ?
|
||||||
|
(sessionStorage.windowScrollX = window.scrollX)
|
||||||
|
: (delete sessionStorage.windowScrollX)
|
||||||
|
sessionStorage.windowScrollY = window.scrollY }
|
||||||
|
var restoreScroll = function(){
|
||||||
|
setTimeout(function(){
|
||||||
|
sessionStorage.windowScrollY
|
||||||
|
&& window.scroll(
|
||||||
|
(sessionStorage.windowScrollX ?? 0)*1,
|
||||||
|
sessionStorage.windowScrollY*1) }, 100) }
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="setup()">
|
<body onload="setup(); restoreScroll()">
|
||||||
|
|
||||||
<h3>ToDo</h3>
|
<h3>ToDo</h3>
|
||||||
<pre>
|
<pre>
|
||||||
|
|||||||
@ -463,7 +463,7 @@ var Gallery = {
|
|||||||
return this },
|
return this },
|
||||||
|
|
||||||
// navigate images visually...
|
// navigate images visually...
|
||||||
// XXX these seem not to work with passed list of images...
|
// XXX BUG: these seem not to work with passed list of images...
|
||||||
left: function(images){
|
left: function(images){
|
||||||
var cur = this.current
|
var cur = this.current
|
||||||
var row = this.getRow(cur, images)
|
var row = this.getRow(cur, images)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user