×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: SlickMenu by Compojoom

SlickMenu by Compojoom 13 years 1 month ago #13082

  • Meroveus
  • Meroveus's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 0
Hi! I've used !SlickMenu by Compojoom on my non-commerce site, but this script has very low speed in Opera and Firefox browser. Especially it gives trouble Opera netbook users, the ones who work on slow computers. But in IE8/9 this script hasn't have any problem on netbooks.

Do you have any idea?
 
/*
 * Copyright(C) Compojoom.com. All rights reserved.
 * License http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 *
 * !SlickMenu is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * !SlickMenu is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 
 * Based on Michael Leigeber's TinyAccordion script
 * http://www.leigeber.com/2009/03/accordion/
 * 
 * Fixed for !SlickMenu by Radoslav Salov
 * rado.salov[at]gmail.com
 */
 
var SlickMenu={};
 
SlickMenu.accordion=function(){
	function slider(n){this.n=n; this.a=[];}
	slider.prototype.init=function(t,e,sec,m,o,k){
		var a=$(t), i=s=0, n=a.childNodes, l=n.length; this.s=k||0; this.m=m||0;
		for(i;i=c.m)||(c.d!=1&&h==1)){if(c.d==1){c.style.height='auto'} else {c.style.visibility='hidden';} clearInterval(c.t);}
	};
	return{slider:slider};
}();
 
SlickMenu.dropdown=function(){
	var z=50,s=6,a;
	function dd(n){this.n=n; this.h=[]; this.c=[];};
	dd.prototype.init=function(p,c) {
		a=c;
		var w=document.getElementById(p), s=w.getElementsByTagName('ul'), l=s.length, i=0;
		for(i;i;
		clearInterval(c.t);
		c.style.overflow='hidden';
 
		if(f){
			$(p).addClass(a);
			c.style.display='block';
 
			if(!c.mh){
				c.mh=c.offsetHeight;
				if (SLICKMENU_DROP_ALLOW_HEIGHT){
					c.style.height=0;
				}
			}
			if(!c.mw){
				c.mw=c.offsetWidth;
				if (SLICKMENU_DROP_ALLOW_WIDTH){
					c.style.width=0;
				}
			}
			if(c.mh==c.offsetHeight && c.mw==c.offsetWidth){
				c.style.overflow='visible';
			} else {
				c.style.zIndex=z; z++;
				c.t=setInterval(function(){sl(c,1);},SLICKMENU_DROP_ANIM_SPEED);
			}
		} else {
			$(p).removeClass(a);
			c.t=setInterval(function(){sl(c,-1);},SLICKMENU_DROP_ANIM_SPEED);
		}
	};
	function sl(c,f){
		var h=c.offsetHeight, w=c.offsetWidth, tostop = false;
		var pt = $(c).getStyle('paddingTop').toInt();
		var pb = $(c).getStyle('paddingBottom').toInt();
		if (pt || pb) h = h + ((pt + pb) * f);
		var pl = $(c).getStyle('paddingLeft').toInt();
		var pr = $(c).getStyle('paddingRight').toInt();
		if (pl || pr) w = w + ((pl + pr) * f);
 
		if (SLICKMENU_DROP_ALLOW_HEIGHT && SLICKMENU_DROP_ALLOW_WIDTH) {
			tostop=(((h=c.mh&&f==1))&&((w=c.mw&&f==1)));
		} else if (SLICKMENU_DROP_ALLOW_HEIGHT) {
			tostop=((h=c.mh&&f==1));
		} else if (SLICKMENU_DROP_ALLOW_WIDTH) {
			tostop=((w=c.mw&&f==1));
		}
		if (tostop){
			if(f==1){
				if (SLICKMENU_DROP_ALLOW_OPACITY) {
					c.style.filter='';
					c.style.opacity=1;
				}
				c.style.overflow='visible';
			} else {
				c.style.display='none';
			}
			clearInterval(c.t);
			return;
		}
 
		var d=(f==1)?Math.ceil((c.mh-h)/s):Math.ceil(h/s);
		var dw=(f==1)?Math.ceil((c.mw-w)/s):Math.ceil(w/s);
		var o = 1;
		if (SLICKMENU_DROP_ALLOW_HEIGHT) {
			o=h/c.mh;
		} else if (SLICKMENU_DROP_ALLOW_WIDTH) {
			o=w/c.mw;
		}
		if (SLICKMENU_DROP_ALLOW_OPACITY) {
			c.style.opacity=o;
			c.style.filter='alpha(opacity='+(o*100)+')';
		}
		if (SLICKMENU_DROP_ALLOW_HEIGHT){
			if ((h=c.mh&&f==1)) {
				c.style.height=c.mh+'px';
			} else {
				c.style.height=h+(d*f)+'px';
			}
		}
		if (SLICKMENU_DROP_ALLOW_WIDTH){
			if ((w=c.mw&&f==1)) {
				c.style.height=c.mh+'px';
			} else {
				c.style.width=w+(dw*f)+'px';
			}
		}
		if(!(SLICKMENU_DROP_ALLOW_HEIGHT || SLICKMENU_DROP_ALLOW_WIDTH)) {
			c.style.display='none';
		}
	};
	return{dd:dd};
}();
 

SlickMenu by Compojoom 13 years 1 month ago #13083

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
We've created this one for icetheme nearly 2 years ago... I'm not supporting the code anymore. I would advise you to search for another slick menu - from joomlart or rocketthem.
Daniel
  • Page:
  • 1
Time to create page: 0.124 seconds