• 资源分类:导航筛选
  • 最后更新:2011-11-11
  • 下载积分:4【升级会员送积分】
  • 积分说明:【上传资源赚积分】
  • 收藏
    资源语言: 中文

    一款简洁漂亮的基于jQuery+CSS3实现的带水波动画效果的竖直导航栏代码,鼠标点击导航菜单链接出现水波动画特效。


    js代码

    <script  type="text/javascript" src="https://img.x22t.com/file/2020/04/25/6eaaee32446acaddb89fa300c79dc3bc7367.js"></script>
    <script type="text/javascript">
    //jQuery time
    var parent, ink, d, x, y;
    $(".nav ul li a").click(function(e){
    	parent = $(this).parent();
    	//create .ink element if it doesn"t exist
    	if(parent.find(".ink").length == 0)
    		parent.prepend("<span class="ink"></span>");
    		
    	ink = parent.find(".ink");
    	//incase of quick double clicks stop the previous animation
    	ink.removeClass("animate");
    	
    	//set size of .ink
    	if(!ink.height() && !ink.width())
    	{
    		//use parent"s width or height whichever is larger for the diameter to make a circle which can cover the entire element.
    		d = Math.max(parent.outerWidth(), parent.outerHeight());
    		ink.css({height: d, width: d});
    	}
    	
    	//get click coordinates
    	//logic = click coordinates relative to page - parent"s position relative to page - half of self height/width to make it controllable from the center;
    	x = e.pageX - parent.offset().left - ink.width()/2;
    	y = e.pageY - parent.offset().top - ink.height()/2;
    	
    	//set the position and add class .animate
    	ink.css({top: y+"px", left: x+"px"}).addClass("animate");
    })
    </script>
    

    提示:
    1、资源共享网(www.08i8.com)导航筛选资源《jQuery+CSS3点击水波动画竖直导航栏代码》仅供研究学习请勿商用!
    2、如果发现本资源违法或侵权请【报告管理员】
    3、您所看到的所有资源都是网友分享,资源共享网(www.08i8.com)无法保证都能正常下载使用,
    4、如果您发现资源无法下载或无法使用请【报告管理员】,管理员会联系资源发布者补充新资源!
    5、如果暂时无法补充新资源,【只退积分!不退款!
    6、关注微信公众号:《国资互联联盟》 不迷路!

    标签

    与《jQuery+CSS3点击水波动画竖直导航栏代码》相关的《插件》

    admin
    admin

    0

    0

    0

    ( 此人很懒并没有留下什么~~ )

    首页

    栏目

    搜索

    会员