澳门大发娱乐

*/ _createStyles: function () { if (!styleElement.parentNode) { styleElement.type = "text/css"; document.getElementsByTagName("head")[0].appendChild(styleElement); } }, /** * Removes styles from the */ _removeStyles: function () { if (styleElement.parentNode) { styleElement.parentNode.removeChild(styleElement); } }, /** * Creates Navigation Toggle */ _createToggle: function () { // If there's no toggle, let's create one if (!opts.customToggle) { var toggle = document.createElement("a"); toggle.innerHTML = opts.label; setAttributes(toggle, { "href": "#", "class": "nav-toggle" }); // Determine where to insert the toggle if (opts.insert === "after") { nav.parentNode.insertBefore(toggle, nav.nextSibling); } else { nav.parentNode.insertBefore(toggle, nav); } navToggle = toggle; // There is a toggle already, let's use that one } else { var toggleEl = opts.customToggle.replace("#", ""); if (document.getElementById(toggleEl)) { navToggle = document.getElementById(toggleEl); } else if (document.querySelector(toggleEl)) { navToggle = document.querySelector(toggleEl); } else { throw new Error("The custom nav toggle you are trying to select doesn't exist"); } } }, /** * Closes the navigation when a link inside is clicked. */ _closeOnNavClick: function () { if (opts.closeOnNavClick) { var links = nav.getElementsByTagName("a"), self = this; forEach(links, function (i, el) { addEvent(links[i], "click", function () { if (isMobile) { self.toggle(); } }, false); }); } }, /** * Prevents the default functionality. * * @param {event} event */ _preventDefault: function (e) { if (e.preventDefault) { if (e.stopImmediatePropagation) { e.stopImmediatePropagation(); } e.preventDefault(); e.stopPropagation(); return false; // This is strictly for old IE } else { e.returnValue = false; } }, /** * On touch start we get the location of the touch. * * @param {event} event */ _onTouchStart: function (e) { if (!Event.prototype.stopImmediatePropagation) { this._preventDefault(e); } this.startX = e.touches[0].clientX; this.startY = e.touches[0].clientY; this.touchHasMoved = false; /** * Remove mouseup event completely here to avoid * double triggering the event. */ removeEvent(navToggle, "mouseup", this, false); }, /** * Check if the user is scrolling instead of tapping. * * @param {event} event */ _onTouchMove: function (e) { if (Math.abs(e.touches[0].clientX - this.startX) > 10 || Math.abs(e.touches[0].clientY - this.startY) > 10) { this.touchHasMoved = true; } }, /** * On touch end toggle the navigation. * * @param {event} event */ _onTouchEnd: function (e) { this._preventDefault(e); if (!isMobile) { return; } // If the user isn't scrolling if (!this.touchHasMoved) { // If the event type is touch if (e.type === "touchend") { this.toggle(); return; // Event type was click, not touch } else { var evt = e || window.event; // If it isn't a right click, do toggling if (!(evt.which === 3 || evt.button === 2)) { this.toggle(); } } } }, /** * For keyboard accessibility, toggle the navigation on Enter * keypress too. * * @param {event} event */ _onKeyUp: function (e) { var evt = e || window.event; if (evt.keyCode === 13) { this.toggle(); } }, /** * Adds the needed CSS transitions if animations are enabled */ _transitions: function () { if (opts.animate) { var objStyle = nav.style, transition = "max-height " + opts.transition + "ms"; objStyle.WebkitTransition = objStyle.MozTransition = objStyle.OTransition = objStyle.transition = transition; } }, /** * Calculates the height of the navigation and then creates * styles which are later added to the page */ _calcHeight: function () { var savedHeight = 0; for (var i = 0; i < nav.inner.length; i++) { savedHeight += nav.inner[i].offsetHeight; } var innerStyles = "." + opts.jsClass + " ." + opts.navClass + "-" + this.index + ".opened{max-height:" + savedHeight + "px !important} ." + opts.jsClass + " ." + opts.navClass + "-" + this.index + ".opened.dropdown-active {max-height:9999px !important}"; if (styleElement.styleSheet) { styleElement.styleSheet.cssText = innerStyles; } else { styleElement.innerHTML = innerStyles; } innerStyles = ""; } }; /** * Return new Responsive Nav */ return new ResponsiveNav(el, options); }; if (typeof module !== "undefined" && module.exports) { module.exports = responsiveNav; } else { window.responsiveNav = responsiveNav; } }(document, window, 0)); var cbpHorizontalMenu = (function () { var lis = $("#cbp-hrmenu > ul > li"), links = lis.children("a"); function f() { lis.on("mouseover", handleLinksMouseOver); lis.on("mouseout", handleLinksMouseOut); lis.on("click", function (h) { h.stopPropagation() }) } function handleLinksMouseOver(event) { // if (d !== -1) { // lis.eq(d).removeClass("cbp-hropen") // } var parentLi = $(event.currentTarget), parentLiIndex = parentLi.index(); // if (d === parentLiIndex) { // parentLi.removeClass("cbp-hropen"); // d = -1 // } else { parentLi.addClass("cbp-hropen"); // d = parentLiIndex; // $body.off("click").on("click", e) // } return true } function handleLinksMouseOut(event) { // if (d !== -1) { // lis.eq(d).removeClass("cbp-hropen") // } var i = $(event.currentTarget), h = i.index(); // if (d === h) { i.removeClass("cbp-hropen"); // d = -1 // } else { // i.addClass("cbp-hropen"); // d = h; // $body.off("click").on("click", e) // } return true } function e(h) { // lis.eq(d).removeClass("cbp-hropen"); lis.removeClass("cbp-hropen"); // d = -1 } return { init: f } })(); var navigation = responsiveNav(".nav-collapse", { animate: true, // Boolean: Use CSS3 transitions, true or false transition: 284, // Integer: Speed of the transition, in milliseconds label: "Menu", // String: Label for the navigation toggle insert: "after", // String: Insert the toggle before or after the navigation customToggle: "", // Selector: Specify the ID of a custom toggle closeOnNavClick: false, // Boolean: Close the navigation when one of the links are clicked openPos: "relative", // String: Position of the opened nav, relative or static navClass: "nav-collapse", // String: Default CSS class. If changed, you need to edit the CSS too! navActiveClass: "js-nav-active", // String: Class that is added to element when nav is active jsClass: "js", // String: 'JS enabled' class which is added to element init: function () { }, // Function: Init callback open: function () { }, // Function: Open callback close: function () { } // Function: Close callback }); $(function () { cbpHorizontalMenu.init(); });

2018金砖五国会议