Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
in my project,

i have two pages
on first page, show all products with image,
when i click on any product image,
redirect to another page and on that page i get clicked product image & description also,

now i want to zoom image on mouse hover,
i use
http://www.dynamicdrive.com/dynamicindex4/featuredimagezoomer.js[^]

but did get solution..
i use jquery but i got so many error like Jquery is not defined and so on....

please give me a another solution ...
please help me...
thnx
Posted
Comments
ZurdoDev 30-Jan-12 10:02am    
Well, if you are getting Jquery is not defined errors your jquery library is likely not getting loaded. You need to download it and include it also.
Sergey Alexandrovich Kryukov 30-Jan-12 12:16pm    
You link did not work -- please check up.
--SA
PKriyshnA 30-Jan-12 12:35pm    
from where i can download jquery library and how can i use....
please i am new in jquery...
Sergey Alexandrovich Kryukov 30-Jan-12 12:43pm    
Done, please see the solution. I developed it between these comments...
--SA

I just tried to develop a jQuery method for this:
JavaScript
$(document).ready(function() {
    $("#image").attr("src", "small.png");
    $("#image").hover(
        function() { // mouse pointer goes over the image
            $(this).attr("src", "big.png");
        },
        function() { // mouse pointer goes out
            $(this).attr("src", "small.png");
        }
    );
});


You need to have two versions of the same image with different sizes in pixels; in my code sample, "big.png" is a full-size one, and "small.png" is scaled down by re-sampling; this version is used from the very beginning and when mouse is not over the image.

In HTML, the image should be marked with ID attribute "image" (just for example, matching the above JavaScript sample):
HTML
<img alt="Some image" id="image" />


I works, tested.

[EDIT]

To download and include jQuery, see http://docs.jquery.com/Downloading_jQuery[^].

To get started, see: http://docs.jquery.com/Tutorials:How_jQuery_Works[^].

—SA
 
Share this answer
 
v5
Comments
Tech Code Freak 1-Feb-12 2:55am    
5up!
Sergey Alexandrovich Kryukov 20-May-13 9:14am    
Thank you.
—SA
Try using either:

Magic Zoom
Magic Thumb
Magic Magnify

They don't require jQuery.


http://www.magictoolbox.com/magiczoom/[^]

http://www.magictoolbox.com/magicthumb/[^]

http://www.magictoolbox.com/magicmagnify/[^]
 
Share this answer
 
v2
Comments
Manfred Rudolf Bihy 31-Jan-12 11:20am    
If you actually added links to said tools I'd consider voting for your solution. :)
UXGuru 31-Jan-12 19:10pm    
I thought they were already well known :)

Here you go...

http://www.magictoolbox.com/magiczoom/
http://www.magictoolbox.com/magicthumb/
http://www.magictoolbox.com/magicmagnify/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900