var popWindow;
var videoWindow;
var videoWindowF;
var currentVideo=null;
var currentVideoTitle="";
var currentItem="";
var currentChapter=1;
//window.onload=initPage;
//初始化
function initPage(){
adjustIFrameSize()
bindIframeEvt()
}
function bindIframeEvt(){
// 为IFRAME绑定onload事件
var cnt=document.getElementById("rightmain");
if (cnt.addEventListener) {
cnt.addEventListener("load", adjustIFrameSize, false);
} else {
cnt.attachEvent("onload", adjustIFrameSize);
}
}

//iframe 控制
function adjustIFrameSize() {
var myIframe = document.getElementById("rightmain");
if (myIframe) {
if (myIframe.contentDocument && myIframe.contentDocument.body.offsetHeight) {
// W3C DOM (and Mozilla) syntax
if(myIframe.contentDocument.body.offsetHeight>screen.availHeight-404){
myIframe.height = myIframe.contentDocument.body.offsetHeight+100;
}else{
myIframe.height =screen.availHeight-374
}

} else if (myIframe.Document && myIframe.Document.body.scrollHeight) {
// IE DOM syntax
if(myIframe.Document.body.scrollHeight>screen.availHeight-404){
myIframe.height = myIframe.Document.body.scrollHeight+100;
}else{
myIframe.height=screen.availHeight-374
}
}
}
}

function showTips(target){
target.blur()
var theElement=target.nextSibling
if(theElement.style.display=="inline"){
theElement.style.display="none"
}else{
theElement.style.display="inline"
}
adjustIFrameSize()

}
function showHideAnswer(target){
target.blur()
var theElement=target.parentNode.parentNode.nextSibling
//alert(theElement.style.display)
if(theElement.style.display=="block"){
theElement.style.display="none"
}else{
theElement.style.display="block"
}
adjustIFrameSize()

}
function showHideNote(target){
target.blur()
var theElement=target.parentNode.parentNode.nextSibling
//alert(theElement.style.display)
if(theElement.style.display=="block"){
theElement.style.display="none"
}else{
theElement.style.display="block"
}
adjustIFrameSize()

}
////////////////////////////
function launchVideo(videoID,videoTitle,cc){
if(videoWindowF){
videoWindowF.close();
}
currentVideo=videoID;
currentVideoTitle=videoTitle;
currentChapter=cc;
var videoDirectory=""
if(currentItem=="videolist"){
videoDirectory="../../media/";
}else{
videoDirectory="../../media/";
}
//alert(window.location.href)
videoWindow= window.open(videoDirectory+"videoplayer.html","videos","width=470,height=510,resizable=no,scrollbars=no");
videoWindow.moveTo(0,0);
videoWindow.focus();
}
function launchVideo_f(videoID,videoTitle){
if(videoWindow){
videoWindow.close();
}
if(videoID){
currentVideo=videoID;
}
if(videoTitle){
currentVideoTitle=videoTitle;
}
var videoDirectory="";
var theW=780;
if(screen.availWidth){
theW=screen.availWidth-10;
}
var theH=560;
if(screen.availHeight){
theH=screen.availHeight-40;
}
videoWindowF= window.open(videoDirectory+"videoplayer_f.html","videos_f","width="+theW+",height="+theH+",resizable=yes,scrollbars=no");
videoWindowF.moveTo(0,0);
videoWindowF.focus();
}
////////////////////////////////
function launchQuiz(quizID){
var quizURL=quizID+".html"
popWindow= window.open(quizURL,"popwin","width=579,height=600,resizable=no,scrollbars=yes");
popWindow.focus();
}
function launchReadings(readingID){

var readingURL="readings/"+readingID+".html";
popWindow= window.open(readingURL,"popwin","width=579,height=600,resizable=no,scrollbars=yes");
popWindow.focus();

}
function launchReference(referenceID){

var referenceURL="../references/"+referenceID+".html";
popWindow= window.open(referenceURL,"popwin","width=579,height=550,resizable=no,scrollbars=yes");
popWindow.focus();

}

web 开发之js---js 调用视频播放的更多相关文章

  1. 移动web开发之rem适配布局

    移动web开发之rem适配布局 方案: 页面布局文字能否随着屏幕大小变化而变化 流式布局和flex布局主要针对于宽度布局,那高度如何布局? 怎样让屏幕发生变化的时候元素高度和宽度等比例缩放? 1. r ...

  2. Vim下的Web开发之html,CSS,javascript插件

    Vim下的Web开发之html,CSS,javascript插件   HTML 下载HTML.zip 解压HTML.zip,然后将里面的所有文件copy到C:\Program Files\Vim\vi ...

  3. Web开发之Tomcat&Servlet

    <!doctype html>01 - JavaEE - Tomcat&Servlet figure:first-child { margin-top: -20px; } #wri ...

  4. 原生+H5开发之:js交互【location方式】

    1. 交互方式总结 1Android与JS通过WebView互相调用方法,实际上是: Android去调用JS的代码 JS去调用Android的代码 二者沟通的桥梁是WebView 对于Android ...

  5. 模块化开发之sea.js

    随着时间的推移,原生js越来越强大,es6中的improt,export已经可以实现模块化开发,但可惜的是现在的浏览器还不支持,需要进行编译,相信在不久的将来,一定会大行其道,今天我们来聊聊模块化开发 ...

  6. HTML5+JS手机web开发之jQuery Mobile初涉

    一.起始之语 我一直都是在PC上折腾网页的,这会儿怎么风向周边捣鼓起手机网页开发呢?原因是公司原先使用Java开发的产品,耗了不少人力财力,但是最后的效果却不怎么好.因为,Android系统一套东西, ...

  7. 模块化开发之sea.js实现原理总结

    seajs官网说:seajs是一个模块加载器,所以学习它并不难. 在我的理解就是:本来我们是需要手动创建 script标签 引入 js文件的,但用seajs后,它就自动帮我们完成这些工作. 这里只说实 ...

  8. web 开发之js---ajax 异步处理

    本文介绍了如何创建能够适应不同浏览器的XMLHttpRequest实例,建立和发送请求,并响应服务器.您将开始接触最基本和基础性的有关Ajax的全部对象和编程方法:XMLHttpRequest对象.该 ...

  9. web 开发之js---js 多线程编程

    AJAX 开发中的难题 试试多线程编程 想了解更多 有关作者   转载注明出处:http://www.infoq.com/cn/articles/js_multithread 虽然有越来越多的网站在应 ...

随机推荐

  1. Sql Server cross apply和outer apply

    with result as( select t.str from( ' str union all ' str union all ' str union all ' str union all ' ...

  2. JavaSE-13 内部类

    学习要点 内部类的定义 内部类的应用 内部类 定义 Java的一个类中包含着另一类. A类和B类是C类的外部类.B类是C类的外部类.A类也称为顶层类. 如何使用内部类 public class MyF ...

  3. 2D热力图实例

    <div style="height: 100px; width: 200px" id="heatmap"></div> <scr ...

  4. jQuery任意标签锚点跳转插件

    // 任意锚点平滑跳转插件// 2010-07-15 v1.0(function($){ $.fn.zxxAnchor = function(options){ var defaults = { ie ...

  5. 利用Merge into 改写Update SQL 一例

    前言 客户说,生产系统最近CPU使用率经常达到100%,请DBA帮忙调查一下. 根据客户提供的情况描述及对应时间段,我导出AWR,发现如下问题: 11v41vaj06pjd :每次执行消耗2,378, ...

  6. sizeof and strlen 的区别

    首先,strlen 是函数,sizeof 是运算操作符,二者得到的结果类型为 size_t,即 unsigned int 类型.大部分编译程序在编译的时候就把 sizeof 计算过了,而 strlen ...

  7. Python:socket实现ftp程序

    刚开始学习socket编程,还不是特熟练,码了好长时间,中间遇到许多问题,记录一下用socketserver写ftp server端: #!/usr/bin/env python import soc ...

  8. c++基础_矩阵乘法

    #include <iostream> using namespace std; int main(){ int a,b; cin>>a>>b; long c[a] ...

  9. Java 集合相关

    对整个体系做一个记录,并不涉及详细应用 Object类 1. 重写toString方法 System.out.println可以打印任何对象在于Object类拥有一个方法 public String ...

  10. c语音 dll断点调试方法

    转自:https://blog.csdn.net/qingzai_/article/details/45348613 dll调试方法: 1.把最新生成的dll和pdb放到 启动这个dll 的进程目录下 ...