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"          allowfullscreen="true"         flashvars="file=video/video.mp4" -------flashvars     />  </object>     <a href="video-test.mp4"><img></img></a>----------------- if click iwant value of href in flashvars 

first adding id (you can add css class) hyperlink element be

< 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();

});

});


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -