PageSourceSearch

https://www.ga.gov.au/designs/js/megamenu.js

js ga.gov.au collected 2026-10-01 08:52:21 UTC 21,000 bytes, 574 lines download raw bytes

1!(function(n, i, e, a) {
2    ;(n.navigation = function(t, s) {
3      var o = {
4          responsive: !0,
5          mobileBreakpoint: 991,
6          showDuration: 200,
7          hideDuration: 200,
8          showDelayDuration: 500,
9          hideDelayDuration: 0,
10          submenuTrigger: "hover",
11          effect: "fadeIn",
12          submenuIndicator: !0,
13          submenuIndicatorTrigger: !1,
14          hideSubWhenGoOut: !0,
15          visibleSubmenusOnMobile: !1,
16          fixed: !1,
17          overlay: !0,
18          overlayColor: "rgba(0, 0, 0, 0.5)",
19          hidden: !1,
20          hiddenOnMobile: !1,
21          offCanvasSide: "left",
22          offCanvasCloseButton: !0,
23          animationOnShow: "",
24          animationOnHide: "",
25          onInit: function() {},
26          onLandscape: function() {},
27          onPortrait: function() {},
28          onShowOffCanvas: function() {},
29          onHideOffCanvas: function() {}
30        },
31        r = this,
32        u = Number.MAX_VALUE,
33        d = 1,
34        l = "click.nav touchstart.nav",
35        f = "mouseenter focusin",
36        c = "mouseleave focusout"
37      r.settings = {}
38      var t = (n(t), t)
39      n(t).find(".nav-search").length > 0 &&
40        n(t)
41          .find(".nav-search")
42          .find("form")
43          .prepend(
44            "<span class='nav-search-close-button' tabindex='0'>&#10005;</span>"
45          ),
46        (r.init = function() {
47          ;(r.settings = n.extend({}, o, s)),
48            r.settings.offCanvasCloseButton &&
49              n(t)
50                .find(".nav-menus-wrapper")
51                .prepend(
52                  "<span class='nav-menus-wrapper-close-button'>&#10005;</span>"
53                ),
54            "right" == r.settings.offCanvasSide &&
55              n(t)
56                .find(".nav-menus-wrapper")
57                .addClass("nav-menus-wrapper-right"),
58            r.settings.hidden &&
59              (n(t).addClass("navigation-hidden"),
60              (r.settings.mobileBreakpoint = 99999)),
61            v(),
62            r.settings.fixed && n(t).addClass("navigation-fixed"),
63            n(t)
64              .find(".nav-toggle")
65              .on("click touchstart", function(n) {
66                n.stopPropagation(),
67                  n.preventDefault(),
68                  r.showOffcanvas(),
69                  s !== a && r.callback("onShowOffCanvas")
70              }),
71            n(t)
72              .find(".nav-menus-wrapper-close-button")
73              .on("click touchstart", function() {
74                r.hideOffcanvas(), s !== a && r.callback("onHideOffCanvas")
75              }),
76            n(t)
77              .find(".nav-search-button, .nav-search-close-button")
78              .on("click touchstart keydown", function(i) {
79                i.stopPropagation(), i.preventDefault()
80                var e = i.keyCode || i.which
81                "click" === i.type ||
82                "touchstart" === i.type ||
83                ("keydown" === i.type && 13 == e)
84                  ? r.toggleSearch()
85                  : 9 == e && n(i.target).blur()
86              }),
87            n(t).find(".megamenu-tabs").length > 0 && y(),
88            n(i).resize(function() {
89              r.initNavigationMode(C()), O(), r.settings.hiddenOnMobile && m()
90            }),
91            r.initNavigationMode(C()),
92            r.settings.hiddenOnMobile && m(),
93            s !== a && r.callback("onInit")
94        })
95      var h = function() {
96          n(t)
97            .find(".nav-submenu")
98            .hide(0),
99            n(t)
100              .find("li")
101              .removeClass("focus")
102        },
103        v = function() {
104          n(t)
105            .find("li")
106            .each(function() {
107              n(this).children(".nav-dropdown,.megamenu-panel").length > 0 &&
108                (n(this)
109                  .children(".nav-dropdown,.megamenu-panel")
110                  .addClass("nav-submenu"),
111                r.settings.submenuIndicator &&
112                  n(this)
113                    .children("a")
114                    .append(
115                      "<span class='submenu-indicator'><span class='submenu-indicator-chevron'></span></span>"
116                    ))
117            })
118        },
119        m = function() {
120          n(t).hasClass("navigation-portrait")
121            ? n(t).addClass("navigation-hidden")
122            : n(t).removeClass("navigation-hidden")
123        }
124      ;(r.showSubmenu = function(i, e) {
125        C() > r.settings.mobileBreakpoint &&
126          n(t)
127            .find(".nav-search")
128            .find("form")
129            .fadeOut(),
130          "fade" == e
131            ? n(i)
132                .children(".nav-submenu")
133                .stop(!0, !0)
134                .delay(r.settings.showDelayDuration)
135                .fadeIn(r.settings.showDuration)
136                .removeClass(r.settings.animationOnHide)
137                .addClass(r.settings.animationOnShow)
138            : n(i)
139                .children(".nav-submenu")
140                .stop(!0, !0)
141                .delay(r.settings.showDelayDuration)
142                .slideDown(r.settings.showDuration)
143                .removeClass(r.settings.animationOnHide)
144                .addClass(r.settings.animationOnShow),
145          n(i).addClass("focus")
146      }),
147        (r.hideSubmenu = function(i, e) {
148          "fade" == e
149            ? n(i)
150                .find(".nav-submenu")
151                .stop(!0, !0)
152                .delay(r.settings.hideDelayDuration)
153                .fadeOut(r.settings.hideDuration)
154                .removeClass(r.settings.animationOnShow)
155                .addClass(r.settings.animationOnHide)
156            : n(i)
157                .find(".nav-submenu")
158                .stop(!0, !0)
159                .delay(r.settings.hideDelayDuration)
160                .slideUp(r.settings.hideDuration)
161                .removeClass(r.settings.animationOnShow)
162                .addClass(r.settings.animationOnHide),
163            n(i)
164              .removeClass("focus")
165              .find(".focus")
166              .removeClass("focus")
167        })
168      var p = function() {
169          n("body").addClass("no-scroll"),
170            r.settings.overlay &&
171              (n(t).append("<div class='nav-overlay-panel'></div>"),
172              n(t)
173                .find(".nav-overlay-panel")
174                .css("background-color", r.settings.overlayColor)
175                .fadeIn(300)
176                .on("click touchstart", function(n) {
177                  r.hideOffcanvas()
178                }))
179        },
180        g = function() {
181          n("body").removeClass("no-scroll"),
182            r.settings.overlay &&
183              n(t)
184                .find(".nav-overlay-panel")
185                .fadeOut(400, function() {
186                  n(this).remove()
187                })
188        }
189      ;(r.showOffcanvas = function() {
190        p(),
191          "left" == r.settings.offCanvasSide
192            ? n(t)
193                .find(".nav-menus-wrapper")
194                .css("transition-property", "left")
195                .addClass("nav-menus-wrapper-open")
196            : n(t)
197                .find(".nav-menus-wrapper")
198                .css("transition-property", "right")
199                .addClass("nav-menus-wrapper-open")
200      }),
201        (r.hideOffcanvas = function() {
202          n(t)
203            .find(".nav-menus-wrapper")
204            .removeClass("nav-menus-wrapper-open")
205            .on(
206              "webkitTransitionEnd moztransitionend transitionend oTransitionEnd",
207              function() {
208                n(t)
209                  .find(".nav-menus-wrapper")
210                  .css("transition-property", "none")
211                  .off()
212              }
213            ),
214            g()
215        }),
216        (r.toggleOffcanvas = function() {
217          C() <= r.settings.mobileBreakpoint &&
218            (n(t)
219              .find(".nav-menus-wrapper")
220              .hasClass("nav-menus-wrapper-open")
221              ? (r.hideOffcanvas(), s !== a && r.callback("onHideOffCanvas"))
222              : (r.showOffcanvas(), s !== a && r.callback("onShowOffCanvas")))
223        }),
224        (r.toggleSearch = function() {
225          "none" ==
226          n(t)
227            .find(".nav-search")
228            .find("form")
229            .css("display")
230            ? (n(t)
231                .find(".nav-search")
232                .find("form")
233                .fadeIn(200),
234              n(t)
235                .find(".nav-search")
236                .find("input")
237                .focus())
238            : (n(t)
239                .find(".nav-search")
240                .find("form")
241                .fadeOut(200),
242              n(t)
243                .find(".nav-search")
244                .find("input")
245                .blur())
246        }),
247        (r.initNavigationMode = function(i) {
248          r.settings.responsive
249            ? (i <= r.settings.mobileBreakpoint &&
250                u > r.settings.mobileBreakpoint &&
251                (n(t)
252                  .addClass("navigation-portrait")
253                  .removeClass("navigation-landscape"),
254                S(),
255                s !== a && r.callback("onPortrait")),
256              i > r.settings.mobileBreakpoint &&
257                d <= r.settings.mobileBreakpoint &&
258                (n(t)
259                  .addClass("navigation-landscape")
260                  .removeClass("navigation-portrait"),
261                k(),
262                g(),
263                r.hideOffcanvas(),
264                s !== a && r.callback("onLandscape")),
265              (u = i),
266              (d = i))
267            : (n(t).addClass("navigation-landscape"),
268              k(),
269              s !== a && r.callback("onLandscape"))
270        })
271      var b = function() {
272          n("html").on("click.body touchstart.body", function(i) {
273            0 === n(i.target).closest(".navigation").length &&
274              (n(t)
275                .find(".nav-submenu")
276                .fadeOut(),
277              n(t)
278                .find(".focus")
279                .removeClass("focus"),
280              n(t)
281                .find(".nav-search")
282                .find("form")
283                .fadeOut())
284          })
285        },
286        C = function() {
287          return (
288            i.innerWidth || e.documentElement.clientWidth || e.body.clientWidth
289          )
290        },
291        w = function() {
292          n(t)
293            .find(".nav-menu")
294            .find("li, a")
295            .off(l)
296            .off(f)
297            .off(c)
298        },
299        O = function() {
300          if (C() > r.settings.mobileBreakpoint) {
301            var i = n(t).outerWidth(!0)
302            n(t)
303              .find(".nav-menu")
304              .children("li")
305              .children(".nav-submenu")
306              .each(function() {
307                n(this)
308                  .parent()
309                  .position().left +
310                  n(this).outerWidth() >
311                i
312                  ? n(this).css("right", 0)
313                  : n(this).css("right", "auto")
314              })
315          }
316        },
317        y = function() {
318          function i(i) {
319            var e = n(i)
320                .children(".megamenu-tabs-nav")
321                .children("li"),
322              a = n(i).children(".megamenu-tabs-pane")
323            n(e).on("click.tabs touchstart.tabs", function(i) {
324              i.stopPropagation(),
325                i.preventDefault(),
326                n(e).removeClass("active"),
327                n(this).addClass("active"),
328                n(a)
329                  .hide(0)
330                  .removeClass("active"),
331                n(a[n(this).index()])
332                  .show(0)
333                  .addClass("active")
334            })
335          }
336          if (n(t).find(".megamenu-tabs").length > 0)
337            for (var e = n(t).find(".megamenu-tabs"), a = 0; a < e.length; a++)
338              i(e[a])
339        },
340        k = function() {
341          w(),
342            h(),
343            navigator.userAgent.match(/Mobi/i) ||
344            navigator.maxTouchPoints > 0 ||
345            "click" == r.settings.submenuTrigger
346              ? n(t)
347                  .find(".nav-menu, .nav-dropdown")
348                  .children("li")
349                  .children("a")
350                  .on(l, function(e) {
351                    if (
352                      (r.hideSubmenu(
353                        n(this)
354                          .parent("li")
355                          .siblings("li"),
356                        r.settings.effect
357                      ),
358                      n(this)
359                        .closest(".nav-menu")
360                        .siblings(".nav-menu")
361                        .find(".nav-submenu")
362                        .fadeOut(r.settings.hideDuration),
363                      n(this).siblings(".nav-submenu").length > 0)
364                    ) {
365                      if (
366                        (e.stopPropagation(),
367                        e.preventDefault(),
368                        "none" ==
369                          n(this)
370                            .siblings(".nav-submenu")
371                            .css("display"))
372                      )
373                        return (
374                          r.showSubmenu(
375                            n(this).parent("li"),
376                            r.settings.effect
377                          ),
378                          O(),
379                          !1
380                        )
381                      if (
382                        (r.hideSubmenu(n(this).parent("li"), r.settings.effect),
383                        "_blank" === n(this).attr("target") ||
384                          "blank" === n(this).attr("target"))
385                      )
386                        i.open(n(this).attr("href"))
387                      else {
388                        if (
389                          "#" === n(this).attr("href") ||
390                          "" === n(this).attr("href") ||
391                          "javascript:void(0)" === n(this).attr("href")
392                        )
393                          return !1
394                        i.location.href = n(this).attr("href")
395                      }
396                    }
397                  })
398              : n(t)
399                  .find(".nav-menu")
400                  .find("li")
401                  .on(f, function() {
402                    r.showSubmenu(this, r.settings.effect), O()
403                  })
404                  .on(c, function() {
405                    r.hideSubmenu(this, r.settings.effect)
406                  }),
407            r.settings.hideSubWhenGoOut && b()
408        },
409        S = function() {
410          w(),
411            h(),
412            r.settings.visibleSubmenusOnMobile
413              ? n(t)
414                  .find(".nav-submenu")
415                  .show(0)
416              : (n(t)
417                  .find(".submenu-indicator")
418                  .removeClass("submenu-indicator-up"),
419                r.settings.submenuIndicator &&
420                r.settings.submenuIndicatorTrigger
421                  ? n(t)
422                      .find(".submenu-indicator")
423                      .on(l, function(i) {
424                        return (
425                          i.stopPropagation(),
426                          i.preventDefault(),
427                          r.hideSubmenu(
428                            n(this)
429                              .parent("a")
430                              .parent("li")
431                              .siblings("li"),
432                            "slide"
433                          ),
434                          r.hideSubmenu(
435                            n(this)
436                              .closest(".nav-menu")
437                              .siblings(".nav-menu")
438                              .children("li"),
439                            "slide"
440                          ),
441                          "none" ==
442                          n(this)
443                            .parent("a")
444                            .siblings(".nav-submenu")
445                            .css("display")
446                            ? (n(this).addClass("submenu-indicator-up"),
447                              n(this)
448                                .parent("a")
449                                .parent("li")
450                                .siblings("li")
451                                .find(".submenu-indicator")
452                                .removeClass("submenu-indicator-up"),
453                              n(this)
454                                .closest(".nav-menu")
455                                .siblings(".nav-menu")
456                                .find(".submenu-indicator")
457                                .removeClass("submenu-indicator-up"),
458                              r.showSubmenu(
459                                n(this)
460                                  .parent("a")
461                                  .parent("li"),
462                                "slide"
463                              ),
464                              !1)
465                            : (n(this)
466                                .parent("a")
467                                .parent("li")
468                                .find(".submenu-indicator")
469                                .removeClass("submenu-indicator-up"),
470                              void r.hideSubmenu(
471                                n(this)
472                                  .parent("a")
473                                  .parent("li"),
474                                "slide"
475                              ))
476                        )
477                      })
478                  : n(t)
479                      .find(".nav-menu, .nav-dropdown")
480                      .children("li")
481                      .children("a")
482                      .on(l, function(e) {
483                        if (
484                          (e.stopPropagation(),
485                          e.preventDefault(),
486                          r.hideSubmenu(
487                            n(this)
488                              .parent("li")
489                              .siblings("li"),
490                            r.settings.effect
491                          ),
492                          r.hideSubmenu(
493                            n(this)
494                              .closest(".nav-menu")
495                              .siblings(".nav-menu")
496                              .children("li"),
497                            "slide"
498                          ),
499                          "none" ==
500                            n(this)
501                              .siblings(".nav-submenu")
502                              .css("display"))
503                        )
504                          return (
505                            n(this)
506                              .children(".submenu-indicator")
507                              .addClass("submenu-indicator-up"),
508                            n(this)
509                              .parent("li")
510                              .siblings("li")
511                              .find(".submenu-indicator")
512                              .removeClass("submenu-indicator-up"),
513                            n(this)
514                              .closest(".nav-menu")
515                              .siblings(".nav-menu")
516                              .find(".submenu-indicator")
517                              .removeClass("submenu-indicator-up"),
518                            r.showSubmenu(n(this).parent("li"), "slide"),
519                            !1
520                          )
521                        if (
522                          (n(this)
523                            .parent("li")
524                            .find(".submenu-indicator")
525                            .removeClass("submenu-indicator-up"),
526                          r.hideSubmenu(n(this).parent("li"), "slide"),
527                          "_blank" === n(this).attr("target") ||
528                            "blank" === n(this).attr("target"))
529                        )
530                          i.open(n(this).attr("href"))
531                        else {
532                          if (
533                            "#" === n(this).attr("href") ||
534                            "" === n(this).attr("href") ||
535                            "javascript:void(0)" === n(this).attr("href")
536                          )
537                            return !1
538                          i.location.href = n(this).attr("href")
539                        }
540                      }))
541        }
542      ;(r.callback = function(n) {
543        s[n] !== a && s[n].call(t)
544      }),
545        r.init()
546    }),
547      (n.fn.navigation = function(i) {
548        return this.each(function() {
549          if (a === n(this).data("navigation")) {
550            var e = new n.navigation(this, i)
551            n(this).data("navigation", e)
552          }
553        })
554      })
555  })(jQuery, window, document)
556
557  ;(function($) {
558    "use strict"
559
560    var $window = $(window)
561
562    if ($.fn.navigation) {
563      $("#navigation1").navigation()
564      $("#always-hidden-nav").navigation({
565        hidden: true
566      })
567    }
568
569    $window.on("load", function() {
570      $("#preloader").fadeOut("slow", function() {
571        $(this).remove()
572      })
573    })
574  })(jQuery)

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.