Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantic Ui Dropdown on hover

I want my semantic ui dropdown menu to trigger on hover instead of click, it works on click, but not hover.

Javascript:

$('.ui.dropdown').dropdown({on:'hover'});

HTML:

<div class="ui dropdown item">
    <i class="fa fa-users"></i> Members <i class="fa fa-caret-down"></i>
    <div class="menu">
        <a class="item"><i class="fa fa-users"></i> Players</a>
        <a class="item"><i class="fa fa-user-md"></i> Staff</a>
    </div>
</div>
like image 383
ryr11 Avatar asked Apr 23 '14 16:04

ryr11


1 Answers

If you want hover effect to open dropdown menu then you don't need to use javascript, instead you can add class simple to your parent div:

<div class="ui simple dropdown item">
    <i class="fa fa-users"></i> Members <i class="fa fa-caret-down"></i>
    <div class="menu">
        <a class="item"><i class="fa fa-users"></i> Players</a>
        <a class="item"><i class="fa fa-user-md"></i> Staff</a>
    </div>
</div>

Fiddle Demo

like image 65
Felix Avatar answered Sep 22 '22 02:09

Felix