is it possible to enlarge an image by 50% onmousover when it is in a table td and i do not want to affect the rest of the table layout.
i am after a rollover effect for images
If the image is taking up 50% of the TD, or less, yes.
__________________ ^_^
If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
* The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".
You can do it pretty easily, actually, but using a "POPON" <div> that you make appear right over the <td>.
Now...there is a a problem: Once the popon appears, it will hide the <td> and the original <img>, so immediately the mouse is no longer "over" either of them and so if you also have onmouseout to hide the popon, it will be hidden. At which point the mouse will again be over the <td> and it will popon again. At which point...
So the "trick" is to decide how to handle the onmouseout. You *could* simply do onmouseout of the enlarged image, but if it's 50% bigger than the original <td> that means it will be slopping over into the adjacent <td>s.
So...how do you think you want to handle the onmouseout?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
im not sure but i think its worth just playing with it and see what happens.
here is a demo page i am working on. http://www.g-e-s.co.uk
please take a look and i know the source is to much but the page works
I don't know if I could stand to work on that page without throwing it all away and rewriting it.
Anyway, it's sure no wonder it takes forever for your page to load.
But, yes, I can show you how to do the 1.5x image blowup without affecting the rest of the display. But as slow as this page is now, are you sure this is a good idea?
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
lol
yea its a good idea.
and i have been trimming it all down with for loops and stuff.
this page used to be a lot bigger.
I'm still a newbie when it comes to JavaScripts
the page takes so long to load due to all the .png files i am using.
soon to be gif files which should help a bit.
bare in mind that the adverts on there can change quantity. and size.
at the moment there is 33 adverts "images" which is the max and in the admin page i can set it to be anything under 33 and for arguments sake it could be 3 adverts then the images would already be a little larger.
so i could do with a way to expand by percentage really
Yes, but the way you use SYNCHRONOUS AJAX to go get content may be the worst of all possible ideas. It means that you have to wait for EACH AND EVERY ONE of those tiny little text files. WHY?
Surely this page is produced via server-side code? No? PHP/ASP/JSP? If not, it certainly should be. And those PNG thumbnails are HUGE considering the small sizes of the images. What's wrong there? Are you saving them uncompressed?? Hmmm...no, guess not. Well, you could save them as GIF and they would be 40% of the PNG size, and still preserve the transparency.
I just think you are making the whole thing way over-complicated and, as a consequence, bigger and slower.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Wow! That sure all seems overly complicated, VW. I'm sure it works, as your code always does, but wow.
I would have created a single <div> that is normally not displayed. Containing an <img> of the appropriate size by with no src=
When, when the mouse is over the thumbnail image, I'd have just calculated the location of the thumbnail (using offsetTop and offsetLeft, recursively), moved the <div> to the appropriate offsets therefrom, and cloned the src of the thumbnail into the <div>s img. Finally, display the <div>.