0

当我尝试更改嵌入式电影 (quicktime) 的 src 属性时,它奇怪地在 Firefox 中本地工作,但在 Firefox 的服务器上不起作用,在本地或服务器上的 Safari 中不起作用,而且它不起作用在 IE 中。

我尝试以下建议:

    $(".image_thumb ul li ul li").click(function(){     
var imgTitle = $(this).find('a').attr("href");  
var imgDesc = $(this).find('.block').html(); 
var imgDescHeight = $(".main_image").find('.block').height();   

if ($(this).is(".active")) {  
    return false; 
} else {
    alert(imgTitle);
    var videoClone = $(".main_image object").clone()
       .find("embed").attr({src: imgTitle}).end()  
       .find("param:first").attr({value: imgTitle});
    $(".main_image object").remove();
    $(".main_image").append(videoClone);

    $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
        $(".main_image .block").html(imgDesc).animate({ opacity: 0.85,  marginBottom: "0" }, 250 );

    });
}
//more code

这根本不会使电影出现。一切都加载了,但电影。有谁知道为什么?当然,我不可能是唯一一个使用闪光灯以外的东西来加载电影的人。

html(如果有帮助):

<div id="vid_wrapper">
    <div class="main_image">
        <object width="160" height="144"
        classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
        codebase="http://www.apple.com/qtactivex/qtplugin.cab">
        <param name="src" value="../images/Intro-1.mov">
        <param name="autoplay" value="true">
        <param name="controller" value="false">




        <EMBED SRC="../images/Intro-1.mov" WIDTH=500 HEIGHT=380 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE="http://www.apple.com/quicktime/"> <!--    <img src="" alt="video_1"> -->
        </object>


        <div style="display: block;" class="desc">
            <a href="#" class="collapse">Close Me!</a>
            <div style="opacity: 0.85; margin-bottom: 0px; display: block;" class="block">
                    <h2>Video 1</h2>
                    <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
                </div>
        </div>
    </div>

    <div class="demo lists image_thumb">
            <ul>
              <li class="expand">Admin System
                <ul class="collapse">
                  <li class="active"> 

            <a href="../images/Intro-1.mov">
                <img src="../images/banner1_thumb.jpg" alt="video_1">
            </a>
            <div class="block">
                <h2>Video 1</h2>
                <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
            </div>
        </li>    
                  <li>
            <a href="../images/Intro-2.mov">
                <img src="../images/banner1_thumb.jpg" alt="video_2">
            </a>
            <div class="block">
                <h2>Video 2</h2>
                <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
            </div>
        </li>
                </ul>

              </li>
              <li class="expand">Enrollment System
                <ul class="collapse">
                  <li>
            <a href="../images/Intro-1.mov">
                <img src="../images/banner1_thumb.jpg" alt="video_3">
            </a>
            <div class="block">
                <h2>Video 3</h2>
                <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
            </div>
        </li>    

                  <li>
            <a href="video4.jpg">
                <img src="../images/banner1_thumb.jpg" alt="video_4">
            </a>
            <div class="block">
                <h2>Video 4</h2>
                <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
            </div>
        </li>
                </ul>
              </li>
              <li class="expand">Inventory System
                <ul class="collapse">

                  <li>
            <a href="video5.jpg">
                <img src="../images/banner1_thumb.jpg" alt="video_5">
            </a>
            <div class="block">
                <h2>Video 5</h2>
                <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
            </div>
        </li>

                  <li> 
            <a href="video6.jpg">
                <img src="../images/banner1_thumb.jpg" alt="video_6">
            </a>
            <div class="block">
                <h2>Video 6</h2>
                <p>Autem conventio nimis quis ad, nisl secundum sed, facilisi, vicis augue regula, ratis, autem. Neo nostrud letatio aliquam validus eum quadrum, volutpat et.</p>
            </div>
        </li>

                </ul>
              </li>
            </ul>    
        </div>
</div>  

感谢您的任何回复。

4

2 回答 2

0

我没有使用嵌入式对象,但我猜测浏览器在加载 src 属性后不会响应它的更改。

不知道这是否可行,但尝试克隆对象,删除现有对象,更改克隆对象的属性,然后将其添加回文档中。

像这样的东西:

var videoClone = $(".main_image object").clone()
   .find("embed").attr({src: imgTitle}).end()  
   .find("param:first").attr({value: imgTitle});
$(".main_image object").remove();
$(".main_image").append(videoClone);
于 2010-11-22T05:08:54.553 回答
0

尝试设置参数 wmode="transparent" 然后做 z-index 的事情..

于 2012-08-07T09:48:11.107 回答