Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery Popup/Popout
    primarykey
    data
    text
    <p>I have 11 images in a row and I want a popout to come out of them if the mouse hovers on one of them. So each 11 images has a different popout. I already have some code to do this, but it will only work on the first image.</p> <p>Code: <strong>index.html</strong></p> <pre><code>&lt;span title="Milestones" class="tl-icon"&gt; &lt;span class="tl-msg"&gt; &lt;span class="tl-msg-inside"&gt; &lt;div class="slice1"&gt; &lt;a id="slice1"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice2"&gt; &lt;a id="slice2"&gt;Slice 2&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;------&lt;/em&gt; &lt;/div&gt; &lt;div class="slice3"&gt; &lt;a id="slice3"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice4"&gt; &lt;a id="slice4"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice5"&gt; &lt;a id="slice5"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice6"&gt; &lt;a id="slice6"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice7"&gt; &lt;a id="slice7"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice8"&gt; &lt;a id="slice8"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice9"&gt; &lt;a id="slice9"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;---&lt;/em&gt; &lt;/div&gt; &lt;div class="slice10"&gt; &lt;a id="slice10"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;----&lt;/em&gt; &lt;/div&gt; &lt;div class="slice11"&gt; &lt;a id="slice11"&gt;RSS Feed&lt;/a&gt; &lt;em style="top: -70px; display: none;"&gt;-----&lt;/em&gt; &lt;/div&gt; &lt;/span&gt; </code></pre> <p><strong>style.css</strong> (Here the same code has been copied 11 times, one for each of the popouts/images)</p> <pre><code>* { margin: 0; padding: 0; border: 0; } .slice1 { float: left; margin-left: 0px; margin-bottom: 0px; margin-right: 0px; margin-top: 0px; padding: 0; width: 700px; position: relative; } div.slice1 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 700px; height: 48px; position: absolute; top: -70px; left: -0px; text-indent: -9999px; z-index: 2; display: none; }. slice2 { float: left; margin: 0px auto; padding: 0; width: 130px; position: relative; } div.slice2 em { font-size: 47px; background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 100px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; z-index: 0; display: none; }. slice3 { margin: 0px auto; padding: 0; width: 220px; position: relative; } div.slice3 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 220px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice4 { margin: 0px auto; padding: 0; width: 70px; position: relative; } div.slice4 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 70px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice5 { margin: 0px auto; padding: 0; width: 250px; position: relative; } div.slice5 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 250px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice6 { margin: 0px auto; padding: 0; width: 380px; position: relative; } div.slice6 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 380px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice7 { margin: 0px auto; padding: 0; width: 170px; position: relative; } div.slice7 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 170px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice8 { margin: 0px auto; padding: 0; width: 30px; position: relative; } div.slice8 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 30px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice9 { margin: 0px auto; padding: 0; width: 110px; position: relative; } div.slice9 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 110px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. slice10 { margin: 0px auto; padding: 0; width: 330px; position: relative; } div.slice10 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 330px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; } slice11 { margin: 0px auto; padding: 0; width: 110px; position: relative; } div.slice11 em { background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/bubble.png) no-repeat; width: 110px; height: 48px; position: absolute; top: -70px; left: -0px; text-align: center; text-indent: -9999px; z-index: 2; display: none; }. #rss-icon { width: 42px; height: 42px; background: url(http://www.dvq.co.nz/wp-content/uploads/2008/07/jquery-popup-bubble/images/icon.png) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice1 { width: 700px; height: 42px; background: url(http://www.kttns.org/yta2) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice2 { width: 130px; height: 42px; background: url(http://www.kttns.org/wexm) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice3 { width: 220px; height: 42px; background: url(http://www.kttns.org/imthi) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice4 { width: 70px; height: 42px; background: url(http://www.kttns.org/wqxnj) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice5 { width: 250px; height: 42px; background: url(http://www.kttns.org/njqxz) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice6 { width: 380px; height: 42px; background: url(http://www.kttns.org/mwi2y) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice7 { width: 170px; height: 42px; background: url(http://www.kttns.org/zlzgm) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice8 { width: 30px; height: 42px; background: url(http://www.kttns.org/djjn) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice9 { width: 210px; height: 42px; background: url(http://www.kttns.org/mmdq) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice10 { width: 330px; height: 42px; background: url(http://www.kttns.org/kodc4) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } #slice11 { width: 110px; height: 42px; background: url(http://www.kttns.org/hyz) no-repeat 0 0; text-indent: -9999px; margin: 0 auto; display: block; } </code></pre> <p><strong>tooltop.js</strong> (The code that makes the popout popout, again one for each of the popouts/images)</p> <pre><code>$(document).ready(function(){ $(".slice1 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice2 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice3 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice4 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice5 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice6 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice7 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice8 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice9 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice10 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); $(document).ready(function(){ $(".slice11 a").hover(function() { $(this).next("em").stop(true, true).animate({opacity: "show", top: "-60"}, "slow"); }, function() { $(this).next("em").animate({opacity: "hide", top: "-70"}, "fast"); }); }); </code></pre> <p>Why does the popout only appear for the first image?</p>
    singulars
    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.
 

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