加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

类似于flash的菜单

发布时间:2020-12-15 18:25:01 所属栏目:百科 来源:网络整理
导读:var indexApp = function(){var _this = this;return {init:function(){_this = this;_this._menu();},_menu:function(){/* $(".menulia").mouseenter(function(){ $(this).animate({backgroundPositionX:"0px",backgroundPositionY:"+=51px"},400); $(".men
var indexApp = function(){
	
	var _this = this;
	
	return {
		
		init:function(){
			_this = this;
			_this._menu();
			
		},_menu:function(){
			/* $(".menu>li>a").mouseenter(function(){
				 
				$(this).animate({
						backgroundPositionX:"0px",backgroundPositionY:"+=51px"},400);	
				
		 
			 $(".menu>li>a").mouseleave(function(){
					
					$(this).animate({
						backgroundPositionX:"0px",400);				
			});
			
		
			
			 })*/
			 $(".menu>li.curr").mouseenter(function(){
				 $(".gradient",this).css("display","block"); 
				 
			 })
			  $(".menu>li.curr").mouseleave(function(){
				 $(".gradient","none"); 
				 
			 })
			 $(".menu>li").not(".curr").mouseenter(function(){
				
				$(".gradient","block"); 
				$(this).animate({
				 		backgroundPositionY:-51+"px"
   					 	},{
						step: function(now,fx){ 

						$(fx.elem).css({"background-position":"0px "+now+"px"});
						
					
						}
					  }
				);
			 })
			  $(".menu>li").not(".curr").mouseleave(function(){
				$(".gradient","none"); 	
				$(this).animate({
				 		backgroundPositionY:0+"px"
   					 	},fx){ 

						$(fx.elem).css({"background-position":"0px "+now+"px"});
						
					
						}
					  }
			   );
			 })
			
		}
$(document).ready(function(){

indexApp.init();
})

demo:http://www.imeiya.com/index.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读