Vue.component('top', {
template: "
",
props: {
rootPath: {
type: String,
default:''
}
},
data () {
return {
menuNames: ['home', 'about', 'news', 'chanye', 'huiyuan', 'fuwuqu', 'gonggao']
};
},
mounted: function() {
this.init();
},
beforeDestroy: function() {
},
methods: {
init: function() {
$("#izl_rmenu").each(function(){
$(this).find(".btn-wx").mouseenter(function(){
$(this).find(".pic").fadeIn("fast");
});
$(this).find(".btn-wx").mouseleave(function(){
$(this).find(".pic").fadeOut("fast");
});
$(this).find(".btn-phone").mouseenter(function(){
$(this).find(".phone").fadeIn("fast");
});
$(this).find(".btn-phone").mouseleave(function(){
$(this).find(".phone").fadeOut("fast");
});
$(this).find(".btn-top").click(function(){
$("html, body").animate({
"scroll-top":0
},"fast");
});
});
var lastRmenuStatus=false;
$(window).scroll(function(){//bug
var _top=$(window).scrollTop();
if(_top>200){
$("#izl_rmenu").data("expanded",true);
}else{
$("#izl_rmenu").data("expanded",false);
}
if($("#izl_rmenu").data("expanded")!=lastRmenuStatus){
lastRmenuStatus=$("#izl_rmenu").data("expanded");
if(lastRmenuStatus){
$("#izl_rmenu .btn-top").slideDown();
}else{
$("#izl_rmenu .btn-top").slideUp();
}
}
});
}
}
});