View Single Post
ישן 30-10-10, 15:01   # 1
IgalSt
מנהל פורום, עסק רשום
 
IgalSt's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: המרכז
גיל: 38
הודעות: 1,432
Send a message via Skype™ to IgalSt

IgalSt לא מחובר  

ראיתי כמה דברים לא כ"כ "נכונים" בקוד שלך, ראה הערות שלי:
HTML קוד:
	$('#cares ul li').mouseover(function() {
		
		// get the on li num and add 1 ( start at 0 )
		ItemNum = $(this).index()+1; //use ++ and when adding +1

		if ((inout) && (curr != ItemNum)){
		inout = false;
		// set off all li;
		$('#cares ul li').each(function() {  //there is no need for "each" here
			$(this).attr('class', "cares_li2"); //using "addClass"/"removeClass" is more "reader friendly"
		});
ובקשר לבעיה עצמה:
לדגעתי עליך לעבוד עם ה-callback של fadeOut/fadeIn
ככל הנראה אתה מבצע שינויים לפני שהאנימציה הסתיימה ולכן הכל נדפק.
ראה בריפרנס של fadeOut/fadeIn אפשרות לביצוע callback בגמר האנימציה.
לדוגמא ככה:
HTML קוד:
$('....').fadeIn(100, function(){
  $(this).fadeOut(500,function(){
    alert('end of animation');
  });
});
  Reply With Quote