var V={
    init: function(){
        $(".o-wrap").niceScroll({
            cursorcolor: "#d9d9d9",  
            cursorwidth: "8",
            cursoropacity: 1,
            cursorborder: 'none',
            autohidemode: false
        })
        V.triggerTab("video-tab");
    },
    triggerTab : function(id){  //tab切换
        $ul=$("#"+id);
        $ul.on("click","li",function(){
            var $showul= $($(this).attr("data-id"));
            var $imgs = $showul.find("img");
            $(this).addClass("selected").siblings().removeClass("selected");
            $showul.show().siblings("ul").hide();
            // 替换图片
            $imgs.each(function(){
                var $this=$(this);
                $this.attr("src",$this.attr("data-src"));
            });
        })
    }
}
V.init();