Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'mouseenter .ui-menu-item': function (event) {
- var target = $(event.currentTarget),
- submenu = this.options.menus,
- ulElement,
- ulElementWidth,
- width,
- targetPageX,
- rightBound;
- if (target.has(submenu)) {
- ulElement = target.find(submenu);
- if (ulElement[0] && !ulElement[0].classList.contains('level0')) {
- var cssTop = event.target.offsetTop,
- ele = $(ulElement[0]);
- window.setTimeout(function () {
- ele.css('top', cssTop).animate({top: cssTop}, 20);
- }, this.options.delay-10);
- }
- ulElementWidth = ulElement.outerWidth(true);
- width = target.outerWidth() * 2;
- targetPageX = target.offset().left;
- rightBound = $(window).width();
- if (ulElementWidth + width + targetPageX > rightBound) {
- ulElement.addClass('submenu-reverse');
- }
- if (targetPageX - ulElementWidth < 0) {
- ulElement.removeClass('submenu-reverse');
- }
- }
- // Remove ui-state-active class from siblings of the newly focused menu item
- // to avoid a jump caused by adjacent elements both having a class with a border
- target.siblings().children('.ui-state-active').removeClass('ui-state-active');
- this.focus(event, target);
- },
Add Comment
Please, Sign In to add comment