View Single Post
ישן 30-10-10, 01:53   # 4
benb
חבר בקהילה
 
benb's Avatar
 
מיני פרופיל
תאריך הצטרפות: Apr 2010
הודעות: 138

benb לא מחובר  

ציטוט:
נכתב במקור על ידי hi_sorie צפה בהודעה
HTML קוד:
var texts = new Array("בלה בלה 1","בלה בלה 2","בלה בלה 3","בלה בלה 4","בלה בלה 5","בלה בלה 6");
var inout = true;
var curr;
var fade = 350;

	$('#cares ul li').mouseover(function() {
		
		// get the on li num and add 1 ( start at 0 )
		ItemNum = $(this).index()+1;

		if ((inout) && (curr != ItemNum)){
		inout = false;
		// set off all li;
		$('#cares ul li').each(function() {
			$(this).attr('class', "cares_li2");
		});
		// set on the curr li
		$(this).fadeOut(fade).attr('class', "cares_li1").fadeIn(fade);
		
$(document).ready(function() {
		
		// change the side pic
		$(".cares_si").fadeOut(fade).attr('src', wb_url+"/templates/home_temp/images/cares_si"+ItemNum+".png").fadeIn(fade);
		$(".cares_si").attr('title', texts[ItemNum-1]);
		$(".cares_si").attr('alt', texts[ItemNum-1]);
		$(".cares_si").simpletooltip();
		
		
		// change the text on the pic
		$("#cares_white_line").fadeOut(fade).html(texts[ItemNum-1]).fadeIn(fade);
		
		curr = ItemNum;
		inout = true;
		}
	});
});


אני חושב שבגלל הפונקציה של FADEIN FADEOUT כי אם אתה עובר מהר אז יש תור של פונקציות שמחכות לרוץ ולעשות את האפקט והן כל פעם שואלות THIS? ואז זה מריץ את מספר הפעמים שהפונקציה רצה על האלמנט שאתה מצביע עליו כעת.
  Reply With Quote