logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > HTML and CSS
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-04-2014, 02:41 PM   #1
dbepp
dbepp's Avatar
 
Join Date: Jun 2011
Location: Indiana
Posts: 93
Default Cycle through webpages

I have a television in our sales department that I would like to cycle information through.. such as our shipping calendar (gmail calendar), sales goals, etc.. all of which are located on separate webpages. Is there a way to cycle through these pages by using HTML?
If not, any other suggestions?
dbepp is offline   Reply With Quote
Old 11-04-2014, 04:59 PM   #2
dbepp
dbepp's Avatar
 
Join Date: Jun 2011
Location: Indiana
Posts: 93
Default

I found something like this.. but can't seem to get the pages to actually display.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Dashboard Example</title>
<style type="text/css">
body, html { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; }
iframe { border: none; }
</style>
<script type="text/javascript">
var Dash = {
nextIndex: 0,

dashboards: [
{url: "http://www.google.com", time: 5},
{url: "http://www.yahoo.com", time: 5},
{url: "http://www.stackoverflow.com", time: 5}
],

display: function()
{
var dashboard = Dash.dashboards[Dash.nextIndex];
frames["displayArea"].location.href = dashboard.url;
Dash.nextIndex = (Dash.nextIndex + 1) % Dash.dashboards.length;
setTimeout(Dash.display, dashboard.time * 1000);
}
};

window.onload = Dash.display;
</script>
</head>
<body>
<iframe name="displayArea" width="100%" height="100%"></iframe>
</body>
</html>
dbepp is offline   Reply With Quote
Old 11-05-2014, 12:36 AM   #3
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

[heres one that works i just mashed it a bit it tests ok

Code:
  <html>
     <head>
        <title></title>
        <style type="text/css">
.show{ height:1000px; width:800px;}
        </style>
        <script type="text/javascript">
           var urls = [
              "http://www.concord-bali-villas.com/index.php"
              ,"http://www.concord-bali-villas.com/reizen/index.php"
              ,"http://www.concord-bali-villas.com/urlaub/index.php"
              ,"http://www.dreamweaverclub.com/forum"
           ];



           function showUrl(idx) {
            
              var f = document.getElementById("f");

              // call the next load  after 5 seconds only after 
              // this iframe loads
              f.onload = function()   {
                 var next = ++idx % urls.length;
                 setTimeout(function(){
                    showUrl(next);
                 }, 5000);  
              }
              // set the src
              f.src = urls[idx];
           }

        </script>
     </head>
     <body onload="showUrl(0)" class="app-chrome">
        <iframe class="show" id="f" src="about:blank"></iframe>
     </body>
  </html>
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-05-2014, 12:37 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

it is also possible with jquery and yu can add transiions
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-05-2014, 05:37 PM   #5
dbepp
dbepp's Avatar
 
Join Date: Jun 2011
Location: Indiana
Posts: 93
Default

Works perfectly, thank you! Except when I change out the webpages you have used, the new ones don't seem to appear. For testing purposes, I've used google and gmail.. it simply shows a blank screen. Thoughts?

<html>
<head>
<title></title>
<style type="text/css">
.show{ height:800px; width:900px;}
</style>
<script type="text/javascript">
var urls = [
"http://www.gmail.com"
,"http://www.google.com"
,"http://www.concord-bali-villas.com/urlaub/index.php"
,"http://www.dreamweaverclub.com/forum"
];



function showUrl(idx) {

var f = document.getElementById("f");

// call the next load after 5 seconds only after
// this iframe loads
f.onload = function() {
var next = ++idx % urls.length;
setTimeout(function(){
showUrl(next);
}, 5000);
}
// set the src
f.src = urls[idx];
}

</script>
</head>
<body onload="showUrl(0)" class="app-chrome">
<iframe class="show" id="f" src="about:blank"></iframe>
</body>
</html>

Last edited by dbepp; 11-05-2014 at 05:49 PM..
dbepp is offline   Reply With Quote
Old 11-06-2014, 01:07 AM   #6
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

well they do use https, so not sure if thats a problem or not
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-06-2014, 01:53 AM   #7
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

ah found this
Google is sending an "X-Frame-Options: SAMEORIGIN" response header you cannot simply set the src to "http://www.google.com" in a iframe.
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 11-06-2014, 12:11 PM   #8
dbepp
dbepp's Avatar
 
Join Date: Jun 2011
Location: Indiana
Posts: 93
Default

Quote:
Originally Posted by edbr View Post
ah found this
Google is sending an "X-Frame-Options: SAMEORIGIN" response header you cannot simply set the src to "http://www.google.com" in a iframe.
Awesome, thanks!
dbepp is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:37 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com