web 开发之js---js 调用视频播放
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 调用视频播放的更多相关文章
- 移动web开发之rem适配布局
移动web开发之rem适配布局 方案: 页面布局文字能否随着屏幕大小变化而变化 流式布局和flex布局主要针对于宽度布局,那高度如何布局? 怎样让屏幕发生变化的时候元素高度和宽度等比例缩放? 1. r ...
- Vim下的Web开发之html,CSS,javascript插件
Vim下的Web开发之html,CSS,javascript插件 HTML 下载HTML.zip 解压HTML.zip,然后将里面的所有文件copy到C:\Program Files\Vim\vi ...
- Web开发之Tomcat&Servlet
<!doctype html>01 - JavaEE - Tomcat&Servlet figure:first-child { margin-top: -20px; } #wri ...
- 原生+H5开发之:js交互【location方式】
1. 交互方式总结 1Android与JS通过WebView互相调用方法,实际上是: Android去调用JS的代码 JS去调用Android的代码 二者沟通的桥梁是WebView 对于Android ...
- 模块化开发之sea.js
随着时间的推移,原生js越来越强大,es6中的improt,export已经可以实现模块化开发,但可惜的是现在的浏览器还不支持,需要进行编译,相信在不久的将来,一定会大行其道,今天我们来聊聊模块化开发 ...
- HTML5+JS手机web开发之jQuery Mobile初涉
一.起始之语 我一直都是在PC上折腾网页的,这会儿怎么风向周边捣鼓起手机网页开发呢?原因是公司原先使用Java开发的产品,耗了不少人力财力,但是最后的效果却不怎么好.因为,Android系统一套东西, ...
- 模块化开发之sea.js实现原理总结
seajs官网说:seajs是一个模块加载器,所以学习它并不难. 在我的理解就是:本来我们是需要手动创建 script标签 引入 js文件的,但用seajs后,它就自动帮我们完成这些工作. 这里只说实 ...
- web 开发之js---ajax 异步处理
本文介绍了如何创建能够适应不同浏览器的XMLHttpRequest实例,建立和发送请求,并响应服务器.您将开始接触最基本和基础性的有关Ajax的全部对象和编程方法:XMLHttpRequest对象.该 ...
- web 开发之js---js 多线程编程
AJAX 开发中的难题 试试多线程编程 想了解更多 有关作者 转载注明出处:http://www.infoq.com/cn/articles/js_multithread 虽然有越来越多的网站在应 ...
随机推荐
- must have same number of columns as the referenced primary key
在使用Hibernate实现多对多的测试过程中遇到了这个问题 解决的方法: 将黄色字段的内容添加进去 <set name="customerSet" table=" ...
- 01CSS使用方法
CSS使用方法 内联定义 内联定义即是在对象的标记内使用对象的style属性定义适用其的样式表属性. 内部样式表 <style type="text/css"></style> ...
- python3+beautifulSoup4.6抓取某网站小说(三)网页分析,BeautifulSoup解析
本章学习内容:将网站上的小说都爬下来,存储到本地. 目标网站:www.cuiweijuxs.com 分析页面,发现一共4步:从主页进入分版打开分页列表.打开分页下所有链接.打开作品页面.打开单章内容. ...
- Go:工厂模式
Go的结构体没有构造函数,通常可以使用工厂模式来解决这个问题. 一个结构体的声明是这样的: package model type Student struct { Name string } 因为 S ...
- python3.x Day5 异常处理
异常处理: 预计可能会发生的异常,明确如果发生,如何处理,不过一般不参与业务逻辑,也不要一次性捕捉全部异常,不然可能程序就不可控了. data={} mmm=[] try: #捕获异常, data[& ...
- Spider-scrapy 中的 xpath 语法与调试
把setting中的机器人过滤设为False ROBOTSTXT_OBEY = False 1 语法 artcile 选取所有子节点 /article 选取根元素 artile article/a 选 ...
- IntelliJ IDEA 13.1.1版本偶然的错误
总之很悲催也很浪费时间,这款软件很喜欢,不想卸载 图片中的style.css使得style.css一直是文本形式 将style.css删除就恢复正常了,这个错误弄了半天才搞定,心累.
- MTK平台 GPU 相关知识
一.什么是Render script,以及mtk平台GPU support情况 [DESCRIPTION] 1.什么是RenderScript ? 2.RenderScript 干什么? 3.MTK平 ...
- 【springmvc】传值的几种方式&&postman接口测试
最近在用postman测试postman接口,对于springmvc传值这一块,测试了几种常用方式,总结一下.对于postman这个工具的使用也增加了了解.postman测试很棒,有了工具,测试接口, ...
- Organize Your Train part II 字典树(此题专卡STL)
Organize Your Train part II Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8787 Acce ...