Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript/css: Make image expand up and to left on rollover effect
    primarykey
    data
    text
    <p>I want to let users expand thumbnail to see large profile pic on mouseover. However, the rollover effect I have currently expands the table row to the size of the expanded image rather than showing the image over the surrounding text. Can anyone suggest a way to expand images on rollover without moving text around, in other words showing larger image on top of other html rather than pushing it out of way. I have tried z-index and this does not seem to work.</p> <p>Here is a jsfiddle that demonstrates the problem:</p> <p><a href="http://jsfiddle.net/gLr9Q/" rel="nofollow">http://jsfiddle.net/gLr9Q/</a></p> <p>Here is same code as in js fiddle:</p> <p></p> <pre><code>&lt;script language="JavaScript"&gt; &lt;!-- hide from non JavaScript Browsers image = new Array() image[0]= new Image(24,24) image[0].src = "http://womeninbiznetwork.com/wp-content/uploads/2011/07/logo-google.thumbnail.gif" image[1] = new Image(48,48) image[1].src = "https://www.google.com/intl/en_ALL/images/logos/images_logo_lg.gif" &lt;/script&gt; &lt;tr&gt;&lt;td colspan=2&gt; &lt;p align="center"&gt; &lt;a href="contactdetail.php" onmouseover="newPic()" onmouseout="oldPic()"&gt; &lt;img src="http://womeninbiznetwork.com/wp-content/uploads/2011/07/logo-google.thumbnail.gif" name="pic" class="rollover" border=0&gt; &lt;/a&gt; &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Here is text&lt;/td&gt;&lt;/tr&gt; </code></pre> <p>js</p> <pre><code>function newPic(){ document.pic.style.left="-24px"; document.pic.style.top="-24px"; document.pic.src = image[1].src; return true; } function oldPic(){ document.pic.src = image[0].src; return true; } </code></pre> <p>css:</p> <pre><code>#rollover { display: block; z-index:99; padding: 4px; position:relative; text-align:left; width:48px; background-color:#E8E8E8; opacity:1.0; filter:alpha(opacity=100); } </code></pre>
    singulars
    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