最新公告
  • 本站一直秉承服务宗旨:履行“站长”责任,销售只是起点 服务永无止境!”的经营理念立即加入
  • jQuery+CSS*击水波动画竖直导航栏代码

    jQuery+CSS*击水波动画竖直导航栏代码插图

    一款简洁漂亮的基于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(functiоn(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. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
    2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
    3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
    4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
    5. 如有链接无法下载、失效或广告,请联系管理员处理!
    6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
    7. 如有侵权麻烦联系邮箱2697381891@qq.com删除文章!

    源码库 » jQuery+CSS*击水波动画竖直导航栏代码
    • 3055会员总数(位)
    • 37766资源总数(个)
    • 0本周发布(个)
    • 0 今日发布(个)
    • 1204稳定运行(天)

    提供最优质的资源集合

    立即查看 了解详情