开发者

jQuery Hovermenu

开发者 https://www.devze.com 2022-12-21 14:51 出处:网络
I have a div(\"dv1\") with AJAX update panel inside which contains multiple dropdown controls. These controls do a postback when the index开发者_StackOverflow is changed. Then I use a jQuery hover fun

I have a div("dv1") with AJAX update panel inside which contains multiple dropdown controls. These controls do a postback when the index开发者_StackOverflow is changed. Then I use a jQuery hover function like the one below:

$('#lblDate').hover($('#dv1').slideDown(),$('#dv1').slideUp());

This works fine when I hover on the label, but whenever I try to select something on any dropdown, the div slides up. Anyone knows a workaround on this?

Thanks


You need to pass functions to hover instead of invoking them, like this:

$('#lblDate').hover(
    function() { $('#dv1').slideDown(); },
    function() { $('#dv1').slideUp(); }
);

Also, you need to use ASP.Net's ClientIDs for your controls, like this:

$('#<%= lblDate.ClientID %>')...

To answer your question, you probably want to wrap the label and the dropdown in a <div> and hover on that.

0

精彩评论

暂无评论...
验证码 换一张
取 消