Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery CSS - floating menu bar
    primarykey
    data
    text
    <p>Creating a widget that displays dynamically generated lists of items. Each item has [img] when clicked shows a hovering menu bar to delete, save, edit that item. I am stuck at how to use CSS to get this to hover to the bottom of the img without affecting the div that img is in? It's a scrollable window so the menu bar has to always be on top when item is close to the bottom within scroll area. Any advice is appreciated.</p> <p>Please see <a href="http://jsfiddle.net/GsrVP/" rel="nofollow">jsFiddle Example</a> to see it in action </p> <p>My List Widget should float menu when [img] clicked for each list element:</p> <pre><code>&lt;div class="scroll"&gt; &lt;ul class="ul1"&gt; &lt;li&gt; &lt;div class="divtop"&gt; &lt;a class="a1" href="javascript:void(0)"&gt;[img]&lt;/a&gt; &lt;ul class="float-menu"&gt; &lt;li&gt;&lt;a href="javascript:void(0)"&gt;X&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:void(0)"&gt;Y&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:void(0)"&gt;Z&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="divsub"&gt;blah&lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;div class="divtop"&gt; &lt;a class="a1" href="javascript:void(0)"&gt;[img]&lt;/a&gt; &lt;ul class="float-menu"&gt; &lt;li&gt;&lt;a href="javascript:void(0)"&gt;X&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:void(0)"&gt;Y&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:void(0)"&gt;Z&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div class="divsub"&gt;blah&lt;/div&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; //jquery code /* by default float menu is hidden */ $('.scroll ul li div ul').hide(); $('.a1').click(function() { $('.a1').next('.float-menu').show(); }); $('.a1').mouseout(function(){ $('.a1').next('.float-menu').hide(); }); //CSS div.scroll { background-color:lightgray; width:450px; height:120px; overflow-y:scroll; } .a1 { float:left; } .divtop { border:1px solid darkgray; } .divsub { margin-right:15px; } .ul1 { list-style-type:none; } .ul1 li { padding-bottom:15px; } .float-menu { list-style-type:none; width:15px; } .float-menu li { padding:0px; border: 1px solid pink; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload