I am using this plugin for jQuery: /
I want to do something when hovering a div element IF dropdown is currently open, or something else if dropdown is currently closed while hovering the div element.
Psuedo code:
$('#foo').hover(function() {
if ( $('*').dropdown('is_visible') ) {
alert('Dropdown is visible, so do something...');
}
else {
alert('Dropdown is NOT visible, so do something else...');
}
});
Can anyone see how this can be acheived with this plugin? Can I search the DOM for some class or something?
Thanks in advance!!
I am using this plugin for jQuery: http://labs.abeautifulsite/jquery-dropdown/
I want to do something when hovering a div element IF dropdown is currently open, or something else if dropdown is currently closed while hovering the div element.
Psuedo code:
$('#foo').hover(function() {
if ( $('*').dropdown('is_visible') ) {
alert('Dropdown is visible, so do something...');
}
else {
alert('Dropdown is NOT visible, so do something else...');
}
});
Can anyone see how this can be acheived with this plugin? Can I search the DOM for some class or something?
Thanks in advance!!
Share Improve this question asked Jul 17, 2014 at 3:42 NickNick 1432 silver badges10 bronze badges2 Answers
Reset to default 4You can seek class "dropdown-open". Might be:
if ($(".dropdown-open").length > 0) {
// A dropdown is opened
} else {
// No opening dropdown
}
The plugin uses a unique id for each dropdown, i.e., dropdown-1, dropdown-2, dropdown-3, etc.
You may use this id to target a specific dropdown. Check wether its css display
is block
or none
.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745200282a4616289.html
评论列表(0条)