Jump to content
  • 0

Выпадающее меню на jquery


T@NKIST
 Share

Question

Хочу создать меню на jquery, но не получается, помогите

Вот кусок html:


<style>
.logoMenu {
border: solid 1px black;
width: 109px;
height: 502px;
top: 30px;
left: 6px;
position: fixed;
display: none;
z-index: 100;
}

.logoMenu .img {
display: block;
height: 26px;
top: 0px !important;
padding: 0 !important;

}
</style>

<div class="upMenu">
<div class="logo"><a href="/"><img src="images/miniLogo.png" onmouseover="logo()" onmouseout="logo2()" title="Домой"/></a></div>
</div>
<div class="logoMenu" onmouseout="logoMenuC()">
<a href="/" class="img"><img src="images/miniNews.png" onmouseover="logoN()" onmouseout="logoN2()" title="Последние новости"/></a>
<a href="/" class="img"><img src="images/miniTop10.png" onmouseover="logoT()" onmouseout="logoT2()" title="Лучшая десятка недели"/></a>
</div>

а вот js:


function logo(){
$('.logo a img[src]').attr('src','images/miniLogo2.png');
$('.logoMenu').show(2);
}

function logo2(){
$('.logo a img[src]').attr('src','images/miniLogo.png');
}

function logoMenuC(){
$('.logoMenu').hide(2);
}

function logoN(){
$('.logoMenu a img[src="images/miniNews.png"]').attr('src','images/miniNews2.png');
}

function logoN2(){
$('.logoMenu a img[src="images/miniNews2.png"]').attr('src','images/miniNews.png');
}

function logoT(){
$('.logoMenu a img[src="images/miniTop10.png"]').attr('src','images/miniTop102.png');
}

function logoT2(){
$('.logoMenu a img[src="images/miniTop102.png"]').attr('src','images/miniTop10.png');
}

в общем когда наводишь на картинку с класса logo то проявляется панелька с меню, когда наводишь на первый элемент меню то все ок но когда ведешь дальше на второй элемент то панелька закрывается

я такое первый раз делаю и не знаю как её точно сделать а скачать готовою я не хочу, хочу свою

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy