473,790 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Want to creat rollover image to larger

Hi,

I want to create this..

A 2 col table with 3 rows down.

In the 1st col I want three thumb size images, 1 in each row

When an image is rolled on, the larger image shows up in col 2

In other words when a thumb is rolled on, its larger image is shown in another
area of the table.

Any help please?

Can do the replace small image with larger okay, but they are in the same position.

I am trying to duplicate something like this..

http://cgi.ebay.com.au/ws/eBayISAPI....4288%26fvi%3D1
Thanks

Rock
Apr 22 '06 #1
10 4724
Hi Rock,

Following are two javascript functions that you will require:

<script language="javas cript">
function showbigimage(co lid, imgName)
{
document.getEle mentById(colid) .innerHTML = "<img src='"+imgName+ "'>";
}

function hidebigimage(co lid)
{
document.getEle mentById(colid) .innerHTML = "";
}
</script>

Here is the HTML table that you will want:

<table border=1>
<tr><td><img src=i1.jpg onmouseover='sh owbigimage("big 1",
"i1_big.jpg ")' onmouseout='hid ebigimage("big1 ")'></td>
<td id='big1'></td></tr>
<tr><td><img src=i2.jpg onmouseover='sh owbigimage("big 2",
"i2_big.jpg ")' onmouseout='hid ebigimage("big2 ")'></td>
<td id='big2'></td></tr>
<tr><td><img src=i3.jpg onmouseover='sh owbigimage("big 3",
"i3_big.jpg ")' onmouseout='hid ebigimage("big3 ")'></td>
<td id='big3'></td></tr>
</table>

Hope this helps

Thanks and God Bless!!

Ehsan
http://ehsan.bdwebwork.com

Apr 22 '06 #2
Thanks Ehsan,

Appreciate the trouble you went to.

It is what I wanted. Now to look at the code so I can understand it.

Regards,

Rock

in OZ.
Ehsan wrote:
Hi Rock,

Following are two javascript functions that you will require:

<script language="javas cript">
function showbigimage(co lid, imgName)
{
document.getEle mentById(colid) .innerHTML = "<img src='"+imgName+ "'>";
}

function hidebigimage(co lid)
{
document.getEle mentById(colid) .innerHTML = "";
}
</script>

Here is the HTML table that you will want:

<table border=1>
<tr><td><img src=i1.jpg onmouseover='sh owbigimage("big 1",
"i1_big.jpg ")' onmouseout='hid ebigimage("big1 ")'></td>
<td id='big1'></td></tr>
<tr><td><img src=i2.jpg onmouseover='sh owbigimage("big 2",
"i2_big.jpg ")' onmouseout='hid ebigimage("big2 ")'></td>
<td id='big2'></td></tr>
<tr><td><img src=i3.jpg onmouseover='sh owbigimage("big 3",
"i3_big.jpg ")' onmouseout='hid ebigimage("big3 ")'></td>
<td id='big3'></td></tr>
</table>

Hope this helps

Thanks and God Bless!!

Ehsan
http://ehsan.bdwebwork.com

Apr 22 '06 #3
ASM
Rock a écrit :
Hi,

I want to create this..

A 2 col table with 3 rows down.

In the 1st col I want three thumb size images, 1 in each row

When an image is rolled on, the larger image shows up in col 2


is it difficult because you need to pre-charge all images

best way would to have all images on the page
some of then styled in invisible

<style type="text/css">
#visual img { position:absolu te; visibility: hidden;}
img#bigest { position: relative }
#visual img.show { visibility: visible }
</style>
<script type="text/javascript">
function hidImages() {
var P = document.getEle mentById('visua l').getElements ByTagName('IMG' );
for(var i=0;i<P.length; i++) P[i].className = '';
}
function showImage(pictI ndex) {
var P = document.getEle mentById('visua l').getElements ByTagName('IMG' );
P[pictIndex-1].className = 'show';
}
</script>

<table>
<tr>
<td>
<img src="thumb/p1.jpg"
onmouseover="sh owImage(1)" onmouseout="hid Images()">
<img src="thumb/p2.jpg"
onmouseover="sh owImage(2)" onmouseout="hid Images()">
<img src="thumb/p3.jpg"
onmouseover="sh owImage(3)" onmouseout="hid Images()">
</td>
<td id="visual">
<img src="photos/p1.jpg">
<img src="photos/p2.jpg" id="bigest">
<img src="photos/p3.jpg">
</td>
</tr>
</table>

in this example your bigest image would be photos/p2.jpg
and you give to it the id 'bigest'
to arrange size of the td to this size
--
Stephane Moriaux et son [moins] vieux Mac
Apr 22 '06 #4
Hi Stephane,

Setting out "visiblity" property will occupy the space even the image
is not being shown/kept hidden, i.e. in the column even if the image is
hidden it will still show the YxY space occupied (width and height of
the image). I think setting "display" property instead will be fine, if
Rock wants to play around with CSS. Am I right?

<style type="text/css">
#visual img { position:absolu te; display: none;}
img#bigest { position: relative }
#visual img.show { display: inline }
</style>

Thanks,

Ehsan

Apr 22 '06 #5
ASM
Ehsan a écrit :
Hi Stephane,

Setting out "visiblity" property will occupy the space
but as images are in absolute, they would occupy same space
(not more space than bigest image with its own style)

on my idea : visibility is a correct use here
<style type="text/css">


perhaps would it miss :

#virtual { position: relative; }

--
Stephane Moriaux et son [moins] vieux Mac
Apr 22 '06 #6
Hi Stephane,

Can you please check out the following two links. One is using your
code, I have only changed the filenames and added a table border. And
one is using your code but display property. You will see the second
column on visibility.html shows a space (i.e. the size of image(s) it
contains. On the other hand display.html does not show the space
occupied.

Please write your views on it.

On display.html I have changed the following line:

#visual img { position:absolu te; visibility: hidden;}

to

#visual img { position:relati ve; display: none;}

Making absolute to relative.

http://ehsan.bdwebwork.com/tests/visibility.html
http://ehsan.bdwebwork.com/tests/display.html

Thanks,

Ehsan

Apr 22 '06 #7
ASM
Hi Ehsan,

you're right :-(
this css are sometimes suprising ...
#visual img { position:relati ve; display: none;}

http://ehsan.bdwebwork.com/tests/display.html
is much more most better.

http://ehsan.bdwebwork.com/tests/visibility.html


could run but 'visual' containing all big images
would have to be a div inside the td
and we lost somme TD's automatisms in centrage (centering?)
--
Stephane Moriaux et son [moins] vieux Mac
Apr 22 '06 #8
There are few more suprises with CSS, even with "display" property. I
have seen, if you set a "display" property for <td> and toggle with
showing the <td> and hidding it, eventually it keeps creating a space
before the <td> space. When it hides a small space before the cell gets
created. If you anyway have to hide the whole <td>, you must start
another table inside the td and set property for the <table> tag.

Anyway if you (Stephane) or anyone else comes up with a solution to
"visibility " property, please post it here.

Thanks and God Bless!!

Ehsan
http://ehsan.bdwebwork.com

Apr 23 '06 #9
ASM
Ehsan a écrit :
There are few more suprises with CSS, even with "display" property. I
have seen, if you set a "display" property for <td>
css for TABLEs TRs and TDs are special
you don't use {display: block} to get them back

http://www.w3.org/TR/CSS21/indexlist.html#index-t
http://www.w3.org/TR/CSS21/tables.ht...def-table-cell

Important :
http://www.w3.org/Style/CSS/
http://www.w3.org/TR/CSS21/

Bookmark this :
http://www.w3.org/TR/CSS21/indexlist.html
and put it in your browser's buttons bar
Anyway if you (Stephane) or anyone else comes up with a solution to
"visibility " property, please post it here.
it is not only a question of visibility, but of positionning too

http://stephane.moriaux.perso.wanado...visibility.htm
http://stephane.moriaux.perso.wanado...ty_variant.htm
Thanks and God Bless!!


I think God is for nothing about miraculous css :-)
--
Stephane Moriaux et son [moins] vieux Mac
Apr 23 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1607
by: Matt | last post by:
i know more-or-less zero about javascript, but my client wants a rollover and he created this code, which doesn't work. All comments are appreciated. 1. the tag: <td align="center" width="66" nowrap="nowrap" background="/work/phc1.10/images/layout/main_nav_bg.gif"> <a href="http://localhost/work/phc1.10/index.php?page=homecare" onmouseover="imgSwap('','gnav_hc_on','gnav_hc_on')" onmouseout="imgSwap('','gnav_hc_off','gnav_hc_off')">
6
3197
by: AJBopp | last post by:
I'm wrestling with CSS variations between Firefox and IE. I'm trying to create rollover buttons in a menu frame. It is working perfectly in Firefox but in IE only the first button is properly highlighted and linked. The second button, has only a partial "hit area" at the top of the image, although if you click the link, you can see the link border is properly place around the image. The rest of the buttons have no rolloever state or link...
2
2798
by: Rob Roberts | last post by:
I am trying to figure out a way to add onmouseover and onmouseout events to ButtonFields in a GridView in order to give them a rollover effect, but so far I haven't been able to figure out a way to do it. Does anyone know how to do this? Thanks in advance, --Rob Roberts
3
1472
by: Rob R. Ainscough | last post by:
Just curious why a VERY commonly used affect of rollover was NOT implemented in .NET 2.0 for web controls? Does anyone have a link to VB code that will show me how to build my own UserControl that will support a rollover? thanks, Rob.
4
1735
by: Dan | last post by:
Hi, I know how to make a rollover image in java, but I have trouble when my photo is a php document like: photo_resize.php? id=2&amp;resize_width=600&amp;resize_height=466 Does anyone know how to make a rollover with images like this? Thanks, Daniel
2
3445
by: Casimir | last post by:
I am looking into making pure CSS image rollovers. Do you have any clever (and robust) CSS rollover-tricks? Or links to such "in the wild"? I have figured out two methods for this, but have yet to do proper testing on browser support. Method I:
2
3048
by: eholz1 | last post by:
Hello CSS and StyleSheet members, I have decided to move away from Dreamweaver javascript rollover buttons, in favor of a CSS type rollover button. (hope that is ok). I plan to use PHP to include the page with the rollover buttons as a php include in a div for navigation buttons (left side of web page). I have cobbled together some code complements of http://sophie-g.net/jobs/css/e_buttons.htm.
8
2634
by: Dave Rado | last post by:
Hi Roderik On 15 Apr, 23:44, Roderik <nos...@atall.nlwrote: The image's position is defined relative to the right hand edge of the text, and depending on the what fonts the user has installed and what browser and OS the are using, that position would vary; how can one give text a background image that is 3px to the right of that text?
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9986
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.