1

I am trying to remove the src attribute from an embed tag of youtube video player in a slider .

It works fine in Fire Fox but do not work in chrome and in IE the video itself is not showing .

here is the fiddle .

and the script that I am trying to use is here

Script

$(document).on('click', '.transparent-btns_nav', function (event) {
    video = $('.transparent-btns1_on').find('object').length;
    if ($('#video1').parents('li').hasClass('transparent-btns1_on')) {
        $('object').find('#video1').attr("src", "http://www.youtube.com/v/PLOUfmig96M?version=3&enablejsapi=1&hl=es_ES&rel=0&color1=0x2b405b&color2=0x6b8ab6&fs=1&border=1&autoplay=1");
    } else {
        $('object').find('#video1').attr("src", "");
    }

});

Edit 1

I think this issue can only be resolved by writing the whole tag using clone . I read in this-->Link got it from one of the StackAnswers

3
  • try using .prop() instead .attr(). Commented Jul 23, 2014 at 11:00
  • Btw, for me its showing video in FF and Chrome (over Linux) Commented Jul 23, 2014 at 11:02
  • yes it shows video in FF and Chrome but in IE no . And I tried prop() same problem do not work in chrome 36.0 (over windows) Commented Jul 23, 2014 at 11:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.