jquery - .Unbind doesnt work with vimeo -
im tryin embed vimeo-video website using jqyuery. when click on button video displaying. , when press close haves close , come original state. embedding works great, closing of video doesnt work. think wrong unbinding.
jquery(document).ready(function() { jquery(".button").bind("click", openvideo); jquery(".closevideo").bind("click", closevideo); function openvideo(){ alert(event.target.id); jquery(this).closest('.post').animate({width: "955px"}, 500); jquery(this).closest('#new-royalslider-1').hide(); jquery(this).closest('.post').children('.videoplayer').show(); jquery(this).closest('.post').children('.videoplayer').html('<iframe src="http://player.vimeo.com/video/'+ event.target.id +'?autoplay=1" width="100%" height="570" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'); } function closevideo(){ alert("close"); jquery(".button").unbind("click", openvideo); }
});
what doing wrong, close button doesnt bring original state
Comments
Post a Comment