jQuery右下角旋转环状菜单特效代码
jquery实现右下角旋转环形菜单特效代码,是固定在页面右下角位置,当用户点击了主菜单按钮后,子菜单项会以环状旋转进入页面,并使用animate.css制作动画效果。
效果图如下:
在线预览 点击下载
html代码:
<div class="htmleaf-container"> <div id='ss_menu'> <div> <i class="fa fa-qq"></i> </div> <div> <i class="fa fa-weibo"></i> </div> <div> <i class="fa fa-weixin"></i> </div> <div> <i class="fa fa-renren"></i> </div> <div class='menu'> <div class='share' id='ss_toggle' data-rot=''> <div class='circle'></div> <div class='bar'></div> </div> </div> </div> </div>
js代码:
$(document).ready(function (ev) { var toggle = $('#ss_toggle'); var menu = $('#ss_menu'); var rot; $('#ss_toggle').on('click', function (ev) { rot = parseInt($(this).data('rot')) - 180; menu.css('transform', 'rotate(' + rot + 'deg)'); menu.css('webkitTransform', 'rotate(' + rot + 'deg)'); if (rot / 180 % 2 == 0) { toggle.parent().addClass('ss_active'); toggle.addClass('close'); } else { toggle.parent().removeClass('ss_active'); toggle.removeClass('close'); } $(this).data('rot', rot); }); menu.on('transitionend webkitTransitionEnd oTransitionEnd', function () { if (rot / 180 % 2 == 0) { $('#ss_menu div i').addClass('ss_animate'); } else { $('#ss_menu div i').removeClass('ss_animate'); } }); });
相关推荐
tztzyzyz 2020-07-05
87281248 2020-07-04
EdwardSiCong 2020-11-23
85477104 2020-11-17
hhanbj 2020-11-17
81427005 2020-11-11
seoppt 2020-09-13
honeyth 2020-09-13
WRITEFORSHARE 2020-09-13
84483065 2020-09-11
momode 2020-09-11
85477104 2020-08-15
83510998 2020-08-08
82550495 2020-08-03
tthappyer 2020-08-03
84901334 2020-07-28
tthappyer 2020-07-25
TONIYH 2020-07-22
tztzyzyz 2020-07-20