Web gallery: Automatic forward

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

Post Reply
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

:D Thank you! :)

Is there somewhere a tutorial (in the net), where I can get closer info about creating my own template and which variables I can use there?

Perhaps it would be a good idea to add an autoredirect (one line of javascript code) to each image page to reach the net image after 10 sec? So you don't need to click on allways "next". just an idea...

thomas
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

to be more concrete (ofr my suggestion) : I see two possibilities:

a) force a (html-) redirect by <meta http-equiv="refresh" content="5; URL=http://www.mysite.com/xnview/IMG_0002.html"> in the html-head

b) make via JavaScript a reload of the next image but this could be stoppable (a button somewhere) as well: self.location or something like window.setTimeout("location.href='target_img.html'",10000); (and check wheather the button was not pressed)

Thomas
Last edited by thire on Sat Aug 06, 2005 8:17 am, edited 1 time in total.
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

transparence for templates

Post by thire »

Anyway it would be good/nice to have some screenshots or a website with examples how the html-templates in the (standard) package look like. Perhaps it would make sense if usesers could store their own examples somewhere and they could then be viewed and downloaded by anyone.
th
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

okay, it was fairly easy. here is the heartpiece of my template: two lines of JavaScript Code.

Code: Select all

<html><head>
<title>img_002</title>

<script type="text/javascript">
aktiv=window.setTimeout("location.href='img_003.html'", 4000);
</script>

</head>

<body>
<a href="img_001.html">previous</a> 
Here you see image img_002.jpg 
<a href="img_003.html">next</a><br>
<a href="javascript:window.clearTimeout(aktiv);">stop</a>

</body>

</html>
Okay, what's going on?
When you create a html page of your images and you choose the option to create a html file for each image, you will see something like http://www.fam.tuwien.ac.at/~thomas/gal ... _2154.html
Now you can click allways on "next" to get to the next image, but it would be cool (here comes my idea) that the next image is shown (loaded) every 4 seconds. I just stare at the screen and see every single image.

In my example you just see picture no. 2 of your gallery. on the left side of the image you have the "previous" link to image no.1 and on the right to image no.3
if you do nothing, after 4 seconds image no. 3 (the next one) is loaded.
but if you like the actual image very much and want to have a closer look at it, click on "stop" and nothing will be loaded automatically. If you want to see the next picture after say 1 minute, click on " next" and after 4 seconds... yes you know it.

very easy, very simple, I just wanted to share it with you!

Thomas
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

Today I tried to display with JavaScript the remaining seconds until the new image will be loaded, but I did not succeed. Any help for me?
Thomas
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Post by helmut »

thire wrote:Today I tried to display with JavaScript the remaining seconds until the new image will be loaded, but I did not succeed. Any help for me?
Thomas
The automatic slide show might be a a nice idea for users. But be aware that loading the images depends very much on the internet connection.

I've searched the internet a bit for the keywords "slideshow" and "HTML" and soon found many infos/pages. E.g.
http://javascript.internet.com/miscella ... eshow.html
looks useful to me. With JavaScript you will depend on browsers that support this. If you (or someone else) find a script that works well, let us know here.
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

of course it will depend on browsers and on useres (some turn JS off), but I guess (don't know why) my two lines aren't that sophisticated so that it will work in many browsers. An if it does not, what will you loose? Well then just just have to click on "next" to reach the next images as it is the case now.
But anyway, this should just be an option (in XnView directly or just a standard template everyone could choose).
Thomas
User avatar
ckv
Posts: 786
Joined: Wed Feb 02, 2005 2:30 pm
Location: Glow
Contact:

Post by ckv »

Why not use meta tag?

Code: Select all

<meta http-equiv="refresh" content="5; url=img_003.html">
Nice and simple and works for sure regardless of javascript.
XnView Tweak UI - Tool to customize your XnView beyond the regular XnView options.
UI-less Settings - Documentation of all the hidden settings in XnView.
XFAM - Tool to create and customize XnView file associations.
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

ckv wrote:Why not use meta tag?

Code: Select all

<meta http-equiv="refresh" content="5; url=img_003.html">
Nice and simple and works for sure regardless of javascript.
because you can't stop it. What when I like the picture so much so that I want to have a closer look at it for 1 min?
otherwise: yes, right!
th
User avatar
TorstenT
Posts: 15
Joined: Tue Aug 16, 2005 3:01 pm
Location: København / Copenhagen
Contact:

Post by TorstenT »

That is precisely the reason why you are strongly recommended not to use the "refresh" tag, e.g. on http://www.submitcorner.com/Guide/Meta/

Regards, Torsten
Torsten Thießenhusen
callto:TorstenThiessenhusen (Skype)
thire
Posts: 118
Joined: Sat Jul 30, 2005 10:26 am
Contact:

Post by thire »

yes, as I said :)
th
Post Reply