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

Community
  • 1
  • 1
Vikram Anand Bhushan
  • 4,836
  • 15
  • 68
  • 130

0 Answers0