Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems with Jquery and Tumblr
    primarykey
    data
    text
    <p>Im using a stupid Javascript combination for my tumblr based homepage to show a random positioned thumbnail on hover and get a bigger picture on click. I have a few problems: </p> <ol> <li><p>tumblr automaticly puts text inside a paragraph, which creates a space behind Link 1 (which doesn't work very well with the ",").</p></li> <li><p>when i have a video that i make bigger and play, it continues to play when the display collapses. </p></li> <li><p>I havent found a solution for creating a wordwrap behind the text before the Links. I would like it to look like this:<br /><br /> Lorem Ipsum is simply dummy text, of the printing and typesetting industry.<br /> Link 1, Link 2</p></li> </ol> <p>I also have to write the image link twice, but i can live with that. </p> <p>Very grateful if somebody helps me. </p> <p>ps. See it in action here: <a href="http://roingbaer.com" rel="nofollow">http://roingbaer.com</a></p> <pre><code>$(".front").each(function() { var right = Math.floor(Math.random()*800); var top = Math.floor(Math.random()*500); $(this).css({'margin-right': right}); $(this).css({'margin-top': top}); }); hoverdiv = $("div.hover") hoverdiv.on("hover", function() { $(this).children(".front").show() }); hoverdiv.on("mouseleave", function() { $(this).children(".front").hide() }) hoverdiv.on("click", function() { $(this).children(".back").toggle() $(this).children(".front").hide() });​ </code></pre> <p>CSS</p> <pre><code>p { margin:0; padding:0; display:inline; } .back { display:none; width:100%; height:100%; position:fixed; top:0; text-align:right; } .front { display:none; max-height:200px; max-width:auto; position:fixed; z-index:-50; top:0; right:100px; } img{ max-width:inherit; max-height:inherit; right:0; top:0; } .hover { cursor:pointer; margin:0; padding:0; font-style:italic; display:inline; } </code></pre> <p>HTML</p> <pre><code> &lt;div class="text"&gt; &lt;p&gt;Lorem Ipsum is simply dummy&lt;/p&gt; &lt;div class="hover"&gt;&lt;a href="http://example.com"&gt;text&lt;/a&gt; &lt;div class="front"&gt;&lt;img src="http://images.roingbaer.com/ludvig.png"/&gt;&lt;/div&gt; &lt;/div&gt; &lt;p&gt;, of the printing and typesetting industry.&lt;/p&gt; &lt;div class="hover"&gt;Link 1 &lt;div class="front"&gt;&lt;img src="http://24.media.tumblr.com/tumblr_lyz7fjMdnN1rp3eymo1_r2_500.jpg"/&gt;&lt;/div&gt; &lt;div class="back"&gt;&lt;img src="http://24.media.tumblr.com/tumblr_lyz7fjMdnN1rp3eymo1_r2_500.jpg"/&gt;&lt;/div&gt; &lt;/div&gt; &lt;p&gt;,&lt;/p&gt; &lt;div class="hover"&gt;Link 2 &lt;div class="front"&gt;&lt;iframe frameborder="0" height="233" src="http://www.youtube.com/embed/VMeXGE_a8Gg" width="400"&gt;&lt;/iframe&gt;&lt;/div&gt; &lt;div class="back"&gt;&lt;iframe frameborder="0" height="480" src="http://www.youtube.com/embed/VMeXGE_a8Gg" width="853"&gt;&lt;/iframe&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; ​ </code></pre>
    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.
    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