如何使我的视频框在页面加载时打开? [英] How do i make my video box open on pageload?

查看:70
本文介绍了如何使我的视频框在页面加载时打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我的实验网站
http://quidpro.comuf.com/punani/index.html [

Heres my very experimental site
http://quidpro.comuf.com/punani/index.html[^]

I am a baby at javascript i tried this:

<script type="text/javascript">
    $(document)ready.function() {
        $("#modal_link").videobox().trigger(''click'');
    });
</script>



不开心!请单击页面上的链接以查看打开的框,我想学习如何使用代码进行此操作.

好吧,我不好的即时通讯v.new到这里发布,我刚刚意识到主机无论如何都会显示不同的代码.以下是我的代码哦,顺便说一句,视频盒是打开视频播放器的幻想盒.
http://videobox-lb.sourceforge.net/ [



No joy! Please click link on page to see box open i want to learn how to do this with code.

OK my bad im v.new to posting here i just realised the host shows different code anyway. below is my code oh btw a videobox is a fancybox that opens a video player. http://videobox-lb.sourceforge.net/[^]

<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>index</title>

<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/videobox.js"></script>
<link rel="stylesheet" href="css/videobox.css" type="text/css" media="screen">
</head>
<body scroll="no" style="background-image: url(BG.jpg);">

<a href="http://www.youtube.com/watch?v=uhi5x7V3WXE" rel="vidbox" title="caption">our video</a>
<br>
</body></html>

推荐答案

(document)ready.function(){
(document)ready.function() {


(#modal_link").videobox().trigger( ''点击''); }); </script>
("#modal_link").videobox().trigger(''click''); }); </script>



不开心!请单击页面上的链接以查看打开的框,我想学习如何使用代码进行此操作.

好吧,我不好的即时通讯v.new到这里发布,我刚刚意识到主机无论如何都会显示不同的代码.以下是我的代码哦,顺便说一句,视频盒是打开视频播放器的幻想盒.
http://videobox-lb.sourceforge.net/ [



No joy! Please click link on page to see box open i want to learn how to do this with code.

OK my bad im v.new to posting here i just realised the host shows different code anyway. below is my code oh btw a videobox is a fancybox that opens a video player. http://videobox-lb.sourceforge.net/[^]

<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>index</title>

<script type="text/javascript" src="js/mootools.js"></script>
<script type="text/javascript" src="js/swfobject.js"></script>
<script type="text/javascript" src="js/videobox.js"></script>
<link rel="stylesheet" href="css/videobox.css" type="text/css" media="screen">
</head>
<body scroll="no" style="background-image: url(BG.jpg);">

<a href="http://www.youtube.com/watch?v=uhi5x7V3WXE" rel="vidbox" title="caption">our video</a>
<br>
</body></html>


我整理了一个示例,该示例还解释了脚本失败的原因.视频盒zip文件已提取到包含html文件的文件夹中.如果您有其他设置,则必须调整脚本和CSS路径:
I''ve put together a sample that also explains why your script failed. The videobox zip file was extracted into the folder that contains the html file. If you have another setup you''ll have to adjust the script and css paths:
<html>
<head>
    <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
    <title>My page loads a video!</title>
    <script type="text/javascript" src="./video/js/mootools.js"></script>
    <script type="text/javascript" src="./video/js/swfobject.js"></script>
    <script type="text/javascript" src="./video/js/videobox.js"></script>
    <link rel="stylesheet" href="./video/css/videobox.css" type="text/css" media="screen">
</head>
<body   scroll="no"
        style="background-image: url(BG.jpg);"
        onload="doOpenVideoDelayed('http://www.youtube.com/watch?v=uhi5x7V3WXE', 'Your cool video!', 'vidbox 800 600 play', 1000);">
    <div style="height: 100%; width: 100%;">
    </div>
</body>
<script type="text/javascript">
    // Since the videobox.js script initializes itself at document onload
    // like this: window.addEvent('domready', Videobox.init.bind(Videobox));
    // you'll have to wait a little while until this has finished. Body onload
    // would be called when videobox.js has not yet been initialized. This will
    // cause errors.
    function doOpenVideoDelayed(url, caption, options, delay)
    {
        // Here we set our function to execute after "delay" milliseconds have passed
        // If you look into videobox.js you'll see that Videobox.click(link) in effect
        // calls Videobox.open(url, caption, options), so I decided to stick with the
        // open() approach insteaf of using click(link). This way es don't even need a
        // link on our page.
        window.setTimeout(  function() {
                                Videobox.open(url, caption, options);
                            },
                            delay
                         );
    }
</script>
</html>


希望这对您有所帮助!
最好的问候,
曼弗雷德(Manfred)


Hope this still helps!
Best regards,
Manfred


这篇关于如何使我的视频框在页面加载时打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆