This article mainly introduces the implementation of the special effect of the rotating ring menu in the lower right corner of jQuery. It has a certain reference value. Now I share it with you. Friends in need can refer to it
jquery realizes the rotation of the lower right corner The ring menu special effects code is fixed at the lower right corner of the page. When the user clicks the main menu button, the submenu items will rotate into the page in a ring shape, and use animate.css to create animation effects. Friends in need can refer to the following
jquery implements the special effect code for the rotating ring menu in the lower right corner, which is fixed at the lower right corner of the page. When the user clicks the main menu button, the submenu items will rotate into the page in a ring, and use animate.css to create animations Effect.
The rendering is as follows:
##html code:
<p class="htmleaf-container"> <p id='ss_menu'> <p> <i class="fa fa-qq"></i> </p> <p> <i class="fa fa-weibo"></i> </p> <p> <i class="fa fa-weixin"></i> </p> <p> <i class="fa fa-renren"></i> </p> <p class='menu'> <p class='share' id='ss_toggle' data-rot=''> <p class='circle'></p> <p class='bar'></p> </p> </p> </p> </p>
js code:
$(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 p i').addClass('ss_animate'); } else { $('#ss_menu p i').removeClass('ss_animate'); } }); });
Introduction to a simple jQuery slideshow plug-in (jquery-slider) based on JSON format data
How to load navigation history when using jQuery mobile class library
Introduction to jquery setting the height of label elements to the percentage of the screen
The above is the detailed content of Implementation of the special effect of rotating ring menu in the lower right corner of jQuery. For more information, please follow other related articles on the PHP Chinese website!