html+js 实现SSRS 报表定时切换

 1 html构建骨架,css简单化妆,js实现切换。
 2 
 3  
 4 
 5 <!DOCTYPE html>
 6 
 7 <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
 8 <head>
 9     <meta charset="utf-8" />
10     <title></title>
11 
12 
13     <style type="text/css">
14         body {
15             margin: 0;
16             padding: 0;
17         }
18 
19         div {
20             position: absolute;
21             width: 100%;
22             height: 100%;
23         }
24      
25 /*#iframeTop {
26  100%;
27 height: 100px;
28 }
29 
30 #iframeLeft {
31  15%;
32 float: left;
33 height: 100%;
34 }*/
35 
36         #iframeContent {
37             width: 100%;//若需要iframeLeft  需修改此处百分比
38             height: 100%;
39             min-height:600px;
40             
41         }
42     </style>
43     <script type="text/javascript">
44         var i = 0;
45         function exchange() {
46             i = i + 1;
47            // var myDate = new Date();//测试用
48             //alert(myDate.getSeconds());
49             switch (i) {
50                 case 1:
51                     document.getElementById("iframeContent").src = "你的链接";
52                     break;
53                 case 2:
54                     document.getElementById("iframeContent").src = "your link";
55                     break;
56 
57                 default:
58                     document.getElementById("iframeContent").src = "your link";
59             }
60             
61             if (i==3) {
62                 i = 0;
63             }
64         }
65         //重复执行某个方法
66         var t= window.setInterval("exchange()", 5000);//5秒一切  时间自定
67         //去掉定时器的方法
68         //window.clearInterval(t);
69     </script>
70     </head>
71     <body>
72         <div>
73             <!--<iframe >-->
74             <!--<iframe >-->
75             <iframe id="iframeContent" name="iframeContent" frameborder="0" src="your link"></iframe>
76         </div>
77     </body>
78 </html>
79   

上述方法可能会出现显示不正常的情况,如在IE上就会如此,此时设置一下IE的兼容性,将IE兼容性全部取消掉后显示正常(小子实测时如此)。

将IE兼容性中所有选项移除,筛选取消,详细情况如下:

 html+js  实现SSRS 报表定时切换