Fadein Fadeout Effectleri ile Jquery Menü
(Baş not: Jquery derslerimizi bir eğitim setine dökmek istiyorum sizin de önerileriniz var ise lütfen bize bildiriniz.)
Demo için Tıklayınız.
Download için Tıklayınız.
Daha önce kullanmış ve anlatmış olduğum fadein fadeout olaylarını kullanarak bir menü nasıl yapabiliriz onu inceleyelim.

1. HTML
Html dosyamız çok basit.Sadece Linklerimizi oluşturacağız.
2 |
<li><a href="#"><b style="color: black; background-color: rgb(255, 153, 153);">Zingocan</b></a></li> |
3 |
<li><a href="#">Test 2</a></li> |
4 |
<li><a href="#">Test 3</a></li> |
5 |
<li><a href="#">Test 4</a></li> |
7 |
<li><a href="#">Test 5</a></li> |
8 |
<li><a href="#">Test 6</a></li> |
2. CSS
CSS biraz karışık bu yüzden yorumlarınız detaylı inceleyeceğim.. Her soru ve sorunuza cevap verebiliriz.
17 |
/* default background image */ |
18 |
background:url(default.jpg) no-repeat center center; |
20 |
/* width and height of the menu item */ |
24 |
/* simulate pixel perfect using border */ |
25 |
border-left:1px solid #111; |
26 |
border-right:1px solid #333; |
27 |
border-top:1px solid #555; |
28 |
border-bottom:1px solid #333; |
30 |
/* must set it as relative, because .hover class top and left with absolute position will be positioned according to li. */ |
35 |
/* z-index must be higher than .hover class */ |
38 |
/* display as block and set the height according to the height of the menu to make the whole LI clickable */ |
47 |
background:url(over.jpg) no-repeat center center; |
49 |
/* must be postion absolute */ |
52 |
/* width, height, left and top to fill the whole LI item */ |
58 |
/* display under the Anchor tag */ |
61 |
/* hide it by default */ |
65 |
#navMenu li.selected { |
67 |
background:url(selected.jpg) no-repeat center center; |
3. Javascript
Jquery içerisine Fadein ve Fadeout olaylarını koyarak yalnızca bir fare ayarlaması yapacağız.. Kodlarda değişiklik yapabilirsiniz yalnız fazla kurcaladığınızda gerçekten bazı durumları değiştirmenin zor olduğunu göreceksiniz..
3 |
$(document).ready(function () { |
5 |
//Append a div with hover class to all the LI |
6 |
$(' navMenu li').append('<div><\/div>'); |
8 |
$(' navMenu li').hover( |
10 |
//Mouseover, <b style="color: black; background-color: rgb(255, 255, 102);">fadeIn</b> the hidden hover class |
13 |
$(this).children('div').<b style="color: black; background-color: rgb(255, 255, 102);">fadeIn</b>('1000'); |
17 |
//Mouseout, <b style="color: black; background-color: rgb(160, 255, 255);">fadeOut</b> the hover class |
20 |
$(this).children('div').<b style="color: black; background-color: rgb(160, 255, 255);">fadeOut</b>('1000'); |
22 |
}).click (function () { |
24 |
//Add selected class if user clicked on it |
25 |
$(this).addClass('selected'); |
Demo için Tıklayınız.
Download için Tıklayınız.
Sonuç
Lütfen Bir sorun yaşarsanız bunu bana yorum olarak bildiriniz. Eğer yapmaya çalıştığınız bilgisayarda tarayıcınız jquery ve javascripti desteklemiyor yada az destekliyorsa istyediğiniz verimi elde edemezsiniz. Ben henüz IE6 da denemedim fakat tam verim elde edileceğiniz sanmıyorum.. sonuç olarak basit bir kaç kod ile devasa siteler nasıl göz doldurur bunu öğrenmiş olduk.. Yorumlarınız için şimdiden teşekkür ediyorum
athletic fit singles pat dating ancientbrit personals cross road dating
aynen öyle cigerim..
Geri izleme: jQuery Fade Menü | Zingocan Dersleri
Geri izleme: jQuery Menü Fadein Fadeout Effectleri | ZingoDers