开发者

JQUERY manipulate embed on click

<object id="player" name="player" width="671" height="442"> 
    <param name="movie" value="player.swf" /> 
    <param name="allowfullscreen" value="true" /> 
    <param name="allowscriptaccess" value="always" /> 
    <param name="flashvars" value="file=video/video.mp4&image=preview.jpg" /> 
    <embed 
        type="application/x-shockwave-flash"
        id="player2"
        name="player2"
        src="player.swf" 
        width="671" 
        height="442"
        allowscriptaccess="always" 
        all开发者_开发问答owfullscreen="true"
        flashvars="file=video/video.mp4" -------FLASHVARS
    /> 
</object> 
   <a href="video-test.mp4"><img></img></a>----------------- if i click this iwant the value of this href to be the in the FLASHVARS


First i am adding id (you can also add some css class) to your hyperlink element so it will be

< a id="lnktochange" href="video-test.mp4">< /a>

$(document).ready(function(){

$("#lnktochange").click(function(e){

var h = $(this).attr("href");

$("#player2").attr("flashvars",h);

e.preventDefault();

});

});

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜