$(function () {
var createVideoBoxAndPlay = function(videoHTML) {
$("body").append("
" + videoHTML + "
");
// let video = $("body").children(".videoBox").find('.video')[0];
$("body > .videoBox .close_search").click(function () {
$(this).parents('.videoBox').remove();
});
};
$(document).on('click', ".p_navContent .p_search", function () {
let videoBox = $('#c_static_001-16420726718590').find(".search_box").html();
createVideoBoxAndPlay(videoBox);
});
$('.videoIBox').each(function(){
let videoImgHref = $(this).find('.videoimg img').attr('src');
$(this).find('.coverImage img').attr('src',videoImgHref);
});
});
//搜索功能代码
$(".videoBox .e_container-45 .e_formBtn-42").click(function() {
if ($(".videoBox .e_input-41 input.form-control").val() == "") {
$(".videoBox .e_input-41").addClass("is-invalid");
$(".videoBox .e_input-41 input.form-control").attr("placeholder", "关键词不能为空!");
} else {
let keyword = $(".videoBox .e_input-41 input.form-control").val();
location.href = "/globalSearch.html?keywords=" + encodeURI(keyword) + "&appIds=all";
}
}) //回车搜索
$("#kw").keyup(function(e){ if(e.keyCode==13){ $("button").trigger("click") } })