PageSourceSearch

https://www.iranitok.com/Portals/_default/Skins/Iranitok/StandardMenu/StandardMenu.js

js iranitok.com collected 2026-10-06 13:14:00 UTC 5,563 bytes, 157 lines download raw bytes

1jQuery(document).ready(function ($) {
2
3    function HoverOver() {
4        $(this).addClass('rmhover') .find(".subMenu").stop().fadeIn('fast');
5			// submenu right align
6			var position	= $(this).offset();
7			var x	= position.left;
8			var width	= $(this).find(".subMenu").width();
9			// position
10			if( x + width > $(window).width() )
11			{
12				$(this).find(".subMenu").css({"right": 0, "left": "auto"});
13			}
14	}
15
16    function HoverOut() {
17         $(this).removeClass('rmhover').find(".subMenu").fadeOut('fast', function() {
18		  $(this).hide(); 
19	  });
20    }
21	
22	function HoverOversub() {
23        $(this).find(".level1").stop().fadeIn('fast');
24     	// SubMenu right align
25			var sublevel = $(".level1", $(this));
26			if(sublevel.length > 0){
27				var offset = sublevel.offset();
28				var rightEage = offset.left + sublevel.outerWidth();
29				if(rightEage > $(window).width()){
30					sublevel.css("left", -180 + "px");
31					sublevel.find(".level2").css("left", -180 + "px");
32					sublevel.find(".level3").css("left", -180 + "px");
33					sublevel.find(".subarrow").css("background", "none");
34				}
35			}
36	}
37
38    function HoverOutsub() {
39         $(this).find(".level1").stop().fadeOut('fast', function() {
40		  $(this).hide(); 
41	  });
42    }
43
44	function HoverOversubsub() {
45        $(this).find(".level2").stop().fadeIn('fast');
46    }
47
48    function HoverOutsubsub() {
49         $(this).find(".level2").stop().fadeOut('fast', function() {
50		  $(this).hide(); 
51	  });
52    }
53
54	var config = {
55        sensitivity: 2,
56        interval:110,
57        over: HoverOver,
58        timeout:110,
59        out: HoverOut
60    };
61    var configsub = {
62        sensitivity: 2,
63        interval:110,
64        over: HoverOversub,
65        timeout:110,
66        out: HoverOutsub
67    };
68    var configsubsub = {
69        sensitivity: 2,
70        interval:110,
71        over: HoverOversubsub,
72        timeout:110,
73        out: HoverOutsubsub
74    };
75	
76    if ($(window).width() >= 768){
77        $("#standardMenu .rootMenu > li.haschild").hoverIntent(config);
78		$("#standardMenu .subMenu li.haschild").hoverIntent(configsub);
79		$("#standardMenu .subMenu li li.haschild").hoverIntent(configsubsub);		
80    }else if ($(window).width() <= 767){
81		$("#standardMenu li.child-1 .navarrow").click(function(event) {
82		  event.preventDefault();
83		  $("#standardMenu li.child-1 .subMenu").slideToggle("fast");
84		  $(this).toggleClass("navarrow2"); return false;	
85		});	
86		$("#standardMenu li.child-2 .navarrow").click(function(event) {
87		  event.preventDefault();
88		  $("#standardMenu li.child-2 .subMenu").slideToggle("fast");
89		  $(this).toggleClass("navarrow2"); return false;
90		});	
91		$("#standardMenu li.child-3 .navarrow").click(function(event) {
92		  event.preventDefault();
93		  $("#standardMenu li.child-3 .subMenu").slideToggle("fast");
94		  $(this).toggleClass("navarrow2"); return false;
95		});	
96		$("#standardMenu li.child-4 .navarrow").click(function(event) {
97		  event.preventDefault();
98		  $("#standardMenu li.child-4 .subMenu").slideToggle("fast");
99		  $(this).toggleClass("navarrow2"); return false;	
100		});	
101		$("#standardMenu li.child-5 .navarrow").click(function(event) {
102		  event.preventDefault();
103		  $("#standardMenu li.child-5 .subMenu").slideToggle("fast");
104		  $(this).toggleClass("navarrow2"); return false;	
105		});	
106		$("#standardMenu li.child-6 .navarrow").click(function(event) {
107		  event.preventDefault();
108		  $("#standardMenu li.child-6 .subMenu").slideToggle("fast");
109		  $(this).toggleClass("navarrow2"); return false;	
110		});	
111		$("#standardMenu li.child-7 .navarrow").click(function(event) {
112		  event.preventDefault();
113		  $("#standardMenu li.child-7 .subMenu").slideToggle("fast");
114		  $(this).toggleClass("navarrow2"); return false;	
115		});	
116		$("#standardMenu li.child-8 .navarrow").click(function(event) {
117		  event.preventDefault();
118		  $("#standardMenu li.child-8 .subMenu").slideToggle("fast");
119		  $(this).toggleClass("navarrow2"); return false;	
120		});	
121		$("#standardMenu li.child-9 .navarrow").click(function(event) {
122		  event.preventDefault();
123		  $("#standardMenu li.child-9 .subMenu").slideToggle("fast");
124		  $(this).toggleClass("navarrow2"); return false;	
125		});	
126		$("#standardMenu li.child-10 .navarrow").click(function(event) {
127		  event.preventDefault();
128		  $("#standardMenu li.child-10 .subMenu").slideToggle("fast");
129		  $(this).toggleClass("navarrow2"); return false;	
130		});	
131		$("#standardMenu li.child-11 .navarrow").click(function(event) {
132		  event.preventDefault();
133		  $("#standardMenu li.child-11 .subMenu").slideToggle("fast");
134		  $(this).toggleClass("navarrow2"); return false;	
135		});	
136		$("#standardMenu li.child-12 .navarrow").click(function(event) {
137		  event.preventDefault();
138		  $("#standardMenu li.child-12 .subMenu").slideToggle("fast");
139		  $(this).toggleClass("navarrow2"); return false;	
140		});	
141	}
142	
143   // For Win8 Tablet
144   $('#standardMenu .haschild li').attr("aria-haspopup","false");
145   $('#standardMenu .haschild li').attr("role","menu");
146   $('#standardMenu .haschild').attr("aria-haspopup","true");
147   $('#standardMenu .haschild').attr("role","menuitem");
148
149	//From Mobile Menu to Tablet/Computer
150	$(window).resize(function() {
151		if( $(window).width() >= 768 ) {
152			$("#standardMenu .rootMenu > li.haschild").hoverIntent(config);
153			$("#standardMenu .subMenu li.haschild").hoverIntent(configsub);
154			$("#standardMenu .subMenu li li.haschild").hoverIntent(configsubsub);	
155		}
156	});
157});

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.