|
|
Subject:
HTML, Java, or ?, Script for rapidy flipping through web addresses.
Category: Computers > Programming Asked by: johnjri1-ga List Price: $3.00 |
Posted:
04 Apr 2005 19:21 PDT
Expires: 04 May 2005 19:21 PDT Question ID: 504999 |
I Would like a link to a free working script that can treat columns of several hundred web adresses as a slide show, preferebly at a fairly quick pace, with forward, reverse, and stop. Faster and slower would be nice,,, but now I'm asking to much, hehe. Example of the data sets I have. http://www.website1.com http://www.website2.com http://www.website3.com etc. etc. http://www.website500.com I'm open to creative solutions. I have a very basic understanding of HTML. John | |
| |
| |
| |
| |
|
|
There is no answer at this time. |
|
Subject:
Re: HTML, Java, or ?, Script for rapidy flipping through web addresses.
From: xarqi-ga on 04 Apr 2005 21:18 PDT |
yeah - it can be done quite easily I think. Set up a web page with two frames. One contains the list of web pages and the buttons and speed parameters to control the action; the other is where the page will be displayed. Click "start", and a javascript runs that sequentially fetches addresses from th elist and displays them in the other frame. It then waits for a period specified in another control field in the first frame, and then gets the next one. The script can check to see if a "stop" button has been pressed, and stop if it has. You can have next and previous buttons that move forwards and bacwards in the list. Overall maximum speed will depend on your internet connection, unless you store copies of all of the pages locally. Somebody else can probably fill in the details here, but this should be a feasible approach. |
Subject:
Re: HTML, Java, or ?, Script for rapidy flipping through web addresses.
From: willcodeforfood-ga on 05 Apr 2005 00:32 PDT |
You can create a webpage slideshow using JavaScript. The one problem is that if you are navigating to external websites, they may well redirect the browser so that their site is the _top URL. This happens, for example, whenever you visit the nytimes.com website. This script will not get your slideshow to pass such a site but will instead get "stuck" on that URL. This could be overcome by writing an application with an embedded Explorer window (control) or writing a browser helper object for IE. Neither would be trivial, but I can help you get you a good start if you need to go to such lengths. On to the example though. You'll need to make two HTML files to get this example working. I tried to keep it all pretty simple, but some of the features required a bit more code. Start by making a file called main.htm and then paste in this HTML (note where to add your URLs in place of the ones I tested): <html> <head> <title>URL Slideshow</title> <script> var frameIdx; var frameUrl = new Array(); frameUrl[0] = "about:blank"; frameUrl[1] = "http://www.cnn.com"; frameUrl[2] = "http://www.espn.com"; frameUrl[3] = "://www.google.com"; frameUrl[4] = "http://www.msn.com"; frameUrl[5] = "http://www.yahoo.com"; // Add more URLs here. <-- LOOK HERE ! ! ! // Just give each subsequent entry // the next higher number. // Do not skip numbers. function show() { document.frames("fmeMain").location.href = frameUrl[frameIdx]; } function first() { frameIdx=0; show(); } function last() { frameIdx=frameUrl.length-1; show(); } function next() { if (frameIdx<frameUrl.length-1) { frameIdx++; show(); } return (frameIdx==frameUrl.length-1) } function prev() { if (frameIdx>0) { frameIdx--; show(); } return (frameIdx==0); } setTimeout("first()",1) </script> </head> <frameset rows="*,30" cols="*"> <frame id="fmeMain" src="about:blank"> <frame id="control" src="control.htm"></frame> </frameset> </html> Now make a file called control.htm and paste in this HTML: <html> <head> <style> button {font-weight:bold ; width:40px} </style> <script> var framePause = true; var playDir = 0; function play(inc) { playDir = inc; framePause=false; document.getElementById("cmdPlay").disabled=true; document.getElementById("cmdReverse").disabled=true; document.getElementById("cmdPause").disabled=false; document.getElementById("cmdPrev").disabled=true; document.getElementById("cmdNext").disabled=true; document.getElementById("cmdFirst").disabled=true; document.getElementById("cmdLast").disabled=true; var stat = document.getElementById("cmdStatus"); stat.innerText = (playDir==1 ? "Forward" : "Reverse"); auto(); } function pause() { framePause=true; document.getElementById("cmdPlay").disabled=false; document.getElementById("cmdReverse").disabled=false; document.getElementById("cmdPause").disabled=true; document.getElementById("cmdPrev").disabled=false; document.getElementById("cmdNext").disabled=false; document.getElementById("cmdFirst").disabled=false; document.getElementById("cmdLast").disabled=false; document.getElementById("cmdStatus").innerText = "Paused"; } function next() { var end = parent.next() if (end) { document.getElementById("cmdNext").disabled=true; document.getElementById("cmdLast").disabled=true; if (!document.getElementById("cmdLoop").checked) { document.getElementById("cmdPause").disabled=true; document.getElementById("cmdStatus").innerText = "Paused"; framePause=true; } } if (framePause) { document.getElementById("cmdPrev").disabled=false; document.getElementById("cmdFirst").disabled=false; document.getElementById("cmdReverse").disabled=false; } return end; } function prev() { var end = parent.prev() if (end) { document.getElementById("cmdPrev").disabled=true; document.getElementById("cmdFirst").disabled=true; if (!document.getElementById("cmdLoop").checked) { document.getElementById("cmdPause").disabled=true; document.getElementById("cmdStatus").innerText = "Paused"; framePause=true; } } if (framePause) { document.getElementById("cmdNext").disabled=false; document.getElementById("cmdLast").disabled=false; document.getElementById("cmdPlay").disabled=false; } return end; } function first() { document.getElementById("cmdPrev").disabled=true; document.getElementById("cmdFirst").disabled=true; parent.first() document.getElementById("cmdNext").disabled=false; document.getElementById("cmdLast").disabled=false; document.getElementById("cmdPlay").disabled=false; } function last() { document.getElementById("cmdNext").disabled=true; document.getElementById("cmdLast").disabled=true; parent.last() document.getElementById("cmdPrev").disabled=false; document.getElementById("cmdFirst").disabled=false; document.getElementById("cmdReverse").disabled=false; } function auto() { if (framePause) return; var end; if (playDir==1) end = next(); else end = prev(); if (end) { if (playDir==1) setTimeout("autofirst();", waitsecs()); else setTimeout("autolast();", waitsecs()); } else setTimeout("auto()", waitsecs()); } function autofirst() { if (framePause) return; parent.first(); setTimeout("if (!framePause) play(1)", waitsecs()) } function autolast() { if (framePause) return; parent.last(); setTimeout("if (!framePause) play(-1)", waitsecs()) } function waitsecs() { var w = new Number(document.getElementById("cmdSeconds").value); if (w.isNaN) { document.getElementById("cmdSeconds").value = 10 w = new Number(10); } return w*1000; } </script> </head> <body style="background-color:gainsboro ; margin:2px; font-family:arial"> <nobr> <button id="cmdFirst" onClick="first()" disabled><<<</button> <button id="cmdLast" onClick="last()">>>></button> <button id="cmdPrev" onClick="prev()" disabled><<</button> <button id="cmdNext" onClick="next()">>></button> <button id="cmdReverse" onClick="play(-1)"><</button> <button id="cmdPause" onClick="pause()" disabled>||</button> <button id="cmdPlay" onClick="play(1)">></button> <input id="cmdLoop" type="checkbox">Loop wait<input id="cmdSeconds" size="3" value="10">seconds Status: <span id="cmdStatus" style="font-weight:bold">Paused</span> </nobr> </body> </html> |
Subject:
Re: HTML, Java, or ?, Script for rapidy flipping through web addresses.
From: willcodeforfood-ga on 05 Apr 2005 10:07 PDT |
Make sure to put both files in the same folder. You can name the first file anything you want but the second file has to be named control.htm because this part of the first file: <frame id="control" src="control.htm"></frame> references it by name. |
Subject:
Re: HTML, Java, or ?, Script for rapidy flipping through web addresses.
From: xarqi-ga on 07 Apr 2005 18:39 PDT |
willcodeforfood can't actually post a formal answer as he/she is not one of the annointed ga-researchers. I must say, it was a splendid voluntary effort on his/her part. |
Subject:
Re: HTML, Java, or ?, Script for rapidy flipping through web addresses.
From: willcodeforfood-ga on 10 Apr 2005 19:44 PDT |
Yes, it's me... I'm glad the script worked out for you. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |