Skip to content

Instantly share code, notes, and snippets.

@osamutake
Last active March 25, 2016 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osamutake/1681a6abb9069e00591a to your computer and use it in GitHub Desktop.
Save osamutake/1681a6abb9069e00591a to your computer and use it in GitHub Desktop.
bootstrapのdropdownを自動開閉します
$(function(){
var $this;
var moving = false;
$('li.dropdown').on('mousemove', function(){
if (!moving) {
moving = true;
return;
}
$this = $(this);
if ($this.css('float')!='left') return;
$this.addClass('open');
moving = false;
});
$('li.dropdown').hover(function(){
// 何もしない
}, function(){
$this = $(this);
$this.removeClass('open');
moving = false;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment