Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Need help with positioned mouseover

Reply
Thread Tools

Need help with positioned mouseover

 
 
Diane
Guest
Posts: n/a
 
      02-23-2006
This is really puzzling me, maybe its just my feeble brain, that cant see
what Im doing wrong. I am trying to create a page that loads up several
thumbnail images, that when onMouseover. the larger image appears, but
leaves the description text intact. I can easily get it to work the way I
want with just one image on the page, but whenever or whereever on the
page
i try to use the same code (except changing the position) to have another
picture (testing by just using the same pic over again) it stops working..

HEre are the two pages to compare. Is it something obvious that is just
escaping me?

This one works fine

http://freewebs.com/imagetest/zoom.html

This one does not????

http://freewebs.com/imagetest/zoom2.html


Any idea why? or how I can get it to do what I want?

email (remove x) or reply here, any help GREATLY appreciated..


Diane



 
Reply With Quote
 
 
 
 
Jonas Raoni
Guest
Posts: n/a
 
      02-23-2006
Diane wrote:
> http://freewebs.com/imagetest/zoom.html


I couldn't access any of those url's from my country, I had to use "The
Clock" <URL:http://www.the-cloak.com> ='/

> Any idea why? or how I can get it to do what I want?
> email (remove x) or reply here, any help GREATLY appreciated..


Your code is looking strange Mrs. Diana

<DIV STYLE='position=absolute; left:150'><A HREF='#'
ONMOUSEOVER="document.pic.src='big.jpg'"
ONMOUSEOUT="document.pic.src='thumb.jpg'">
<IMG SRC='thumb.jpg' NAME='pic' BORDER='0'></A></DIV>


You should try to follow the w3.org <URL:http://www.w3.org> standards,
for example the name attribute already got deprecated.

Besides that, the problem is: when you have two elements with the same
name, they become a collection. Ex:


<input type="text" name="field" />
<input type="text" name="field" />

To access the first and the second one, you must use form.field[0] and
form.field[1] respectively. The same applies to your images.


--
Jonas Raoni Soares Silva
http://www.jsfromhell.com
 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      02-23-2006
Diane wrote:
> This is really puzzling me, maybe its just my feeble brain, that cant see
> what Im doing wrong. I am trying to create a page that loads up several
> thumbnail images, that when onMouseover. the larger image appears, but
> leaves the description text intact. I can easily get it to work the way I
> want with just one image on the page, but whenever or whereever on the
> page
> i try to use the same code (except changing the position) to have another
> picture (testing by just using the same pic over again) it stops working..


Jonas has given you the reason it fails. You might also consider
ditching the A element altogether, just use a mousever on the thumbnail
itself. Then you can do something like:

<img
style="cursor: pointer;"
src="thumb.jpg"
onmouseover="this.src = 'big.jpg'"
onmouseout="this.src = 'thumb.jpg'"
>


Pre-loading the 'big' images will help to improve response times.


[...]


--
Rob
 
Reply With Quote
 
Diane
Guest
Posts: n/a
 
      02-23-2006
Thank you both!

Ahhh , duhhh using the SAME name attribute, ya that would do it.. sometimes
I just dont see the obvious.

Also I tried using the cursorointer property and that seems to work even
better. Now if I can just figure out how to get the z-index working the way
I want, so that when the big pic comes up, it lays over the text on the next
column over

Thanks for your help.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning of "non-positioned controls" (datasource etc) =?Utf-8?B?TWFya3VzIFJ5dHRlcmt1bGw=?= ASP .Net 0 03-15-2006 08:04 AM
Help with links within relatively positioned table Fat, Dumb and Happy HTML 2 03-01-2005 03:36 PM
hyperlink a positioned image? abby HTML 3 03-01-2005 11:22 AM
flow content following absolutely-positioned panel John A Grandy ASP .Net 3 06-15-2004 12:04 PM
flow content following absolutely-positioned panel John A Grandy ASP .Net 0 06-14-2004 08:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57