PageSourceSearch

https://www.cms-iran.com/Portals/_default/skins/cmsiran/Menus/TopMenu/TopMenu.js?cdv=185

js cms-iran.com collected 2026-10-06 15:05:33 UTC 4,249 bytes, 156 lines download raw bytes

1$(function () {
2  function HoverOver() {
3    var $menu = $(this).addClass("rmhover").find(".subMenu").stop();
4    setDimensions($menu);
5    $menu.slideDown(200).show();
6  }
7  function HoverOut() {
8    $(this)
9      .removeClass("rmhover")
10      .find(".subMenu")
11      .stop()
12      .slideUp(200, function () {
13        $(this).hide();
14      });
15  }
16  function HoverOversub() {
17    var $menu = $(this).find("> .subMenuRight").stop();
18    setDimensions($menu, $(this));
19    $menu.slideDown(150).show();
20  }
21  function HoverOutsub() {
22    $(this)
23      .find("> .subMenuRight")
24      .stop()
25      .slideUp(150, function () {
26        $(this).hide();
27      });
28  }
29  function setDimensions($menu, $parent) {
30    var $window = $(window);
31    var isHidden = $menu.is(":hidden");
32    $menu.show();
33    var windowRight = $window.scrollLeft() + $window.width();
34    var menuLeft = $menu.offset();
35    var menuRight = menuLeft + $menu.width();
36    if (menuRight > windowRight) {
37      if ($parent) {
38        $menu.css("left", 0 - $menu.width() + "px");
39      } else {
40        $menu.css("left", windowRight - menuRight - 5 + "px");
41      }
42    }
43    if (isHidden) {
44      $menu.hide();
45    }
46  }
47  var config = {
48    sensitivity: 2,
49    interval: 0,
50    over: HoverOver,
51    timeout: 100,
52    out: HoverOut,
53  };
54  var configsub = {
55    sensitivity: 2,
56    interval: 0,
57    over: HoverOversub,
58    timeout: 100,
59    out: HoverOutsub,
60  };
61  if ($(window).innerWidth() > 991) {
62    $("#dnnTopMenu .rootMenu > li.haschild")
63      .hoverIntent(config)
64      .touchHover(config);
65    $(".haschild").hoverIntent(config).touchHover(config);
66  }
67
68  $("#dnnTopMenu .rootMenu > li").each(function () {
69    var thisIndex = $(this).index() + 1;
70    $(this).addClass("topMenu" + thisIndex);
71    $(".subTiles", this).attr("id", "SubMenuID" + thisIndex);
72    $("#adTilesStorage div").each(function () {
73      var $adTile = $(this);
74      var submenuId = $adTile.data("submenuId");
75      $("#" + submenuId).append($adTile);
76      $("#" + submenuId + ":not(:empty)")
77        .parent()
78        .addClass("hasAdTile");
79    });
80  });
81  if (!jQuery.support.leadingWhitespace) {
82    $("#dnnTopMenu .subMenu li:nth-child(even)").addClass("even");
83  }
84});
85$(function () {
86  if ($(window).innerWidth() > 991) {
87    $(".topMenu1").addClass("megamenu");
88  }
89});
90jQuery.fn.extend({
91  touchHover: function (cfg) {
92    if (
93      navigator.platform != "iPad" &&
94      navigator.platform != "iPhone" &&
95      navigator.platform != "iPod"
96    ) {
97      return this;
98    }
99    return this.children("a").click(function (evt) {
100      var $this = $(this);
101      var $li = $this.parent("li");
102      if ($li.children("div:visible").length == 0) {
103        evt.preventDefault();
104      }
105    });
106  },
107});
108function i() {
109  return (
110    $(".dnnTopMenu,.dnnTopMenu_bg,.site_bg").removeClass("active"),
111    $("body").removeClass("overflow_hidden"),
112    !1
113  );
114}
115$(".toggle_menu").click(function () {
116  return (
117    $(".dnnTopMenu,.dnnTopMenu_bg,.site_bg").addClass("active"),
118    $("body").toggleClass("overflow_hidden"),
119    !1
120  );
121});
122$(".mobile_menu_close,.site_bg").click(function () {
123  i();
124});
125$(window).resize(function () {
126  $(window).innerWidth() > 991 && i();
127});
128$("#dnnTopMenu li.haschild > span .childnode").click(function () {
129  var e = $(this);
130  $(this).closest("li").toggleClass("nodeactive");
131  $(this).closest("li").find(".subMenu").slideToggle(200);
132});
133$("#dnnTopMenu .subMenu li.haschild span .childnode").click(function () {
134  var e = $(this);
135  $(this).parent(".text").next().slideToggle(200);
136});
137$(document).on("click", "#mobilemenu", function () {
138  $(".dnnTopMenu").toggleClass("active");
139});
140
141$(function () {
142  var lastScrollTop = 0,
143    delta = 5;
144  $(window).scroll(function () {
145    var nowScrollTop = $(this).scrollTop();
146    if (Math.abs(lastScrollTop - nowScrollTop) >= delta) {
147      if (nowScrollTop > lastScrollTop) {
148        $(".Header").removeClass("panel-show");
149      } else {
150        // ACTION ON
151        $(".Header").addClass("panel-show");
152      }
153      lastScrollTop = nowScrollTop;
154    }
155  });
156});

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.