PageSourceSearch

http://prihod-eman.ru/templates/zt_zana25/zt_menus/zt_fancymenu/zt_fancymenu.js

js prihod-eman.ru collected 2026-10-05 00:02:34 UTC 2,072 bytes, 66 lines download raw bytes

1var ZTFancy = new Class({
2	Implements: Options,
3	initialize: function(menu, options){
4		this.setOptions(this.getOptions(), options);
5		this.menu = $(menu), this.current = this.menu.getElement('li[class$=active]');
6		this.menu.getElements('li').each(function(item){
7			if(item.getProperty('class').split(' ')[0] != 'mega-li')
8			{
9				item.addEvent('mouseover', function(){this.moveBg(item);}.bind(this));
10				item.addEvent('mouseout', function(){this.moveBg(this.current);}.bind(this));
11			}
12		}.bind(this));
13		this.wback = 0;
14		this.back = new Element('li').addClass('fancy').adopt(new Element('div').addClass('fancy-center').adopt(new Element('div').addClass('fancy-left')).adopt(new Element('div').addClass('fancy-right'))).injectInside(this.menu);
15		this.back.fx 	= new Fx.Morph(this.back, this.options);
16		if(this.current) this.setCurrent(this.current);
17	},
18
19	setCurrent: function(el, effect){
20		xPos 	= el.offsetLeft;
21		wPos	= el.offsetWidth;
22		tempEl 	= el.offsetParent;
23		while(tempEl != null) {
24			xPos 	+= tempEl.offsetLeft;
25			tempEl 	 = tempEl.offsetParent;
26		}
27		this.back.setStyles({left: (xPos)+'px', width: (wPos)+'px'});
28		(effect) ? this.back.fx = new Fx.Morph(this.back, this.options).set({'opacity': [0, 1]}) : this.back.fx.set({'opacity': 1});
29		this.current = el;
30	},
31
32	getOptions: function(){
33		return {
34			transition: Fx.Transitions.sineInOut,
35			duration: 500, wait: false,
36			xOffset:0,
37			onClick: Class.empty
38		};
39	},
40
41	clickItem: function(event, item) {
42		if(!this.current) this.setCurrent(item, true);
43		this.current = item;
44		this.options.onClick(new Event(event), item);
45	},
46
47	moveBg: function(to) {		
48		if(!this.current) return;
49		this.back.fx.pause();
50		
51		xPos 	= to.offsetLeft;
52		wPos	= to.offsetWidth;
53		tempEl 	= to.offsetParent;
54		
55		while(tempEl != null) {
56			xPos 	+= tempEl.offsetLeft;
57			tempEl 	 = tempEl.offsetParent;
58		}
59		if(this.wback == 0) this.wback = this.back.offsetWidth;
60		this.back.fx.start({
61			'left': [this.back.offsetLeft, xPos],
62			'width': [this.wback, wPos]
63		});
64		this.wback = this.back.offsetWidth;		
65	}
66});

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.