How To Enlarge Image onMouseOver using PHP?

Thread Solved

Join Date: Sep 2006
Posts: 107
Reputation: scorpionz is an unknown quantity at this point 
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster

How To Enlarge Image onMouseOver using PHP?

 
0
  #1
Mar 22nd, 2008
Hi This Is ScorpionZ
I have an Image Gallery and have a PHP code toooo,,,,I Wana know How to Enlarge image when my mouse Over Image
Here is the Code:

  1. <html>
  2. <head>
  3. </head>
  4.  
  5. <body>
  6. <table class="details-box-products" width="511" border="1">
  7. <tr>
  8. <td width="213" rowspan="4" bgcolor="#EFEFE9" align="center">
  9. <strong><a href="#"><img src="./uploaded_images/<?php echo $prod_up_img; ?> " name="prod_up_img" id="prod_up_img" onMouseOver="" width="209" height="175" /></a> </strong>
  10. </td>
  11. </tr>
  12. <table>
  13. </body>
  14. </html>

What type of JavaScript needs to Apply... I have no idea about that.....

Any Response back Will be highly Appreciated with great Interest

Thanks and Regards
Scorpionz


In Addition I have Safe the Image name in DB and Getting the image by name it is Stored in Server....
Last edited by peter_budo; Mar 23rd, 2008 at 5:54 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,426
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 230
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is online now Online
Code Monkey

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #2
Mar 22nd, 2008
onmouseover='this.height += 100;this.width += 100'
That's the most basic version.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #3
Mar 22nd, 2008
adding 100 to the height and width, actually does not maintain the aspect ratio of the image (unless the image is already the same height and width.

If you use a multiplication instead, you should be maintaining the aspect ratio.
Sage
Reply With Quote Quick reply to this message  
Join Date: Feb 2002
Posts: 12,056
Reputation: cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light cscgal is a glorious beacon of light 
Solved Threads: 128
Administrator
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #4
Mar 23rd, 2008
Sagedavis ... Yup, like height *= 2 to double the height ... Remember to also do onmouseout= to restore the height and width back to normal when the mouse moves off of the images. You might also want to add this.src= and fetch a higher resolution version of the image from the server so that you don't end up with images scaled too big for their size.
Dani the Computer Science Gal
Follow my Twitter feed! twitter.com/DaniWeb
And if you're interested in Internet marketing there is twitter.com/DaniWebAds
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 107
Reputation: scorpionz is an unknown quantity at this point 
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #5
Mar 24th, 2008
Hi
first of all Thanks to "ShawnCplus", "sagedavis","cscgal"
for their response back to my thread..... Guys
I m trying it right now and will get back to you Guys as soon as i can
and Will let you knows it what occurs
Again Thanks

Regards
Scorpionz
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 107
Reputation: scorpionz is an unknown quantity at this point 
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #6
Mar 27th, 2008
Hi Guys and Girls
I m Back
First of all direct to the Point Iapplied all the suggestions of you all people and it works
Thanks
But this is not what i am trying to do
Description is that
When i mouse over the image then it opens over some box, like in Div box and then when i mouse out then it dissapears
I m couldnt find on Internet

Thanks and Regards
ScorpionZ
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,761
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #7
Mar 27th, 2008
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 86
Reputation: sagedavis is an unknown quantity at this point 
Solved Threads: 6
sagedavis sagedavis is offline Offline
Junior Poster in Training

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #8
Mar 27th, 2008
OK, well, that's different, you are looking for something like an ajax, hidden div tag which reviels itself on the mousover of another?

Even though you will be using images, think of it more like a customized tooltip.

There is actually a javascript library located at http://blog.innerewut.de/tooltip
which I have used in the past. All that is required is one small piece of code.
Download tooltip.js I believe it may also require prototype.js (not exactly sure about that since it's been a while since I've used it).

Then all you need to do is include them in your head tag, create the two div tags in your body (one hidden, one not), then at the bottom of your page
  1. <script type="text/javascript">
  2. var my_tooltip = new Tooltip('visible_div_id', 'hidden_div_id')
  3. </script>

Replace visible_div_id and hidden_div_id with the id of the coresponding div tags.

What you need to know though is that your visible div tag must have widths, otherwise the trigger will happen an unwanted places.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 107
Reputation: scorpionz is an unknown quantity at this point 
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #9
Mar 30th, 2008
Hi Guys, due to some network problem in my area, i am unable to contact here,
First of all Thanks for the response of "naveen" and "sagedavis"
Now the frame that i was thinking is not that, but it is beyond my expectations, means that you guys Provide such tutorial with examples that are wonderful.I was only trying some lite thing but this tutorial let me force to do some other.....
It Works

Thanks and Regards
ScorpionZ
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 107
Reputation: scorpionz is an unknown quantity at this point 
Solved Threads: 0
scorpionz scorpionz is offline Offline
Junior Poster

Re: How To Enlarge Image onMouseOver using PHP?

 
0
  #10
Mar 30th, 2008
Hi After Visiting to Website and Understanding of tutorials i made this code for testing
and Finding some Problems in execution

  1.  
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <title>My Test</title>
  6. <script type="text/javascript">
  7. popBoxWaitImage.src = "/test_files/images/spinner40.gif";
  8. popBoxRevertImage = "/test_files/images/magminus.gif";
  9. popBoxPopImage = "/test_files/images/magplus.gif";
  10. </script>
  11. <style type="text/css">
  12. .PopBoxImageSmall
  13. {
  14. border: none 0px white;
  15. cursor: url("http://test_files/images/magplus.cur"), pointer;
  16. }
  17. .PopBoxImageLarge
  18. {
  19. border: solid thin #CCCCFF;
  20. cursor: url("http://test_files/images/magminus.cur"), pointer;
  21. }
  22. </style>
  23. </head>
  24.  
  25. <body>
  26. <table border="1">
  27. <tr>
  28. <td >
  29. <img
  30. src="images/my_image.jpg" alt="" width="399" height="253"
  31. class="PopBoxImageSmall" id="imgBlueScoop"
  32. title="Click to magnify/shrink"
  33. onclick="return Pop(this,50,'PopBoxImageLarge');"
  34. pbsrc="images/my_image.jpg"
  35. pbCaption="I don't know where we got these beach toys, but they make for a nice contrasting photograph against the darker sand of Folsom Lake. It's not the greatest beach, but it's a beach, and that's a very nice change from a cube wall" />
  36.  
  37. </td>
  38. </tr>
  39. </table>
  40. </body>
  41. </html>

Now let me describe
I am running it on Mozilla and in its Error Console I find this Bug
"Pop is not defined "
and one important thing
when i move the mouse over to image it is not also showing the mouse as an "+" like magplus.cur this one
So Please view it and let me get out of this Problem .. Any Response will be highly apppreciated

Thanks and Regards
Scorpionz
Last edited by cscgal; Apr 3rd, 2008 at 1:16 am. Reason: Replaced [icode] [/icode] with [code=html] [/code]
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC