• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 489
  • Last Modified:

Code that will produce a javascript magnifier

Please take a look at this jquery code that should produce a nice scrolling magnifier effect.  I updated the image and code links, but I must be missing something.  You can see the working original at: http://ui.jquery.com/repository/latest/demos/functional/#ui.magnifier

Thanks!

John
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Magnifier</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/latest/ui/ui.magnifier.js"></script>
 
<script type="text/javascript">
$(document).ready(function(){
$("#magnifier").magnifier();
}); 
</script>
 
<link href="http://ui.jquery.com/repository/latest/themes/default/ui.all.css" rel="stylesheet" type="text/css" />
 
</head>
    
<body>    
 
<div id="magnifier">
<img src="http://ui.jquery.com/repository/latest/demos/functional/images/clock.png" width="64" height="64" alt="demo image" />
<img src="http://ui.jquery.com/repository/latest/demos/functional/images/clock.png" width="64" height="64" alt="demo image" />
<img src="http://ui.jquery.com/repository/latest/demos/functional/images/clock.png" width="64" height="64" alt="demo image" />
<img src="http://ui.jquery.com/repository/latest/demos/functional/images/clock.png" width="64" height="64" alt="demo image" />
<img src="http://ui.jquery.com/repository/latest/demos/functional/images/clock.png" width="64" height="64" alt="demo image" />
<img src="http://ui.jquery.com/repository/latest/demos/functional/images/clock.png" width="64" height="64" alt="demo image" />
</div>
 
</body>
</html>

Open in new window

0
gabrielPennyback
Asked:
gabrielPennyback
  • 2
  • 2
2 Solutions
 
Pawel WitkowskiSenior Javascript DeveloperCommented:
This is a common problem with their libaries .... just try those set of libaries:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/latest/ui/ui.magnifier.js"></script>
0
 
gabrielPennybackAuthor Commented:
Thanks.  I downloaded the first one last week, but I have no idea how to use. To make matters more complicated, that one is written with no line breaks which makes it virtually impossible for a beginner like me to read..  Is there an easy way to convert that to a readable form with all the proper line breaks?

With regard to the magnifier one, what would the html look like?  Just like the one in their example above?

Thanks,

John
0
 
sh0eCommented:
If you copy paste
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/latest/ui/ui.core.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/latest/ui/ui.magnifier.js"></script>
over your
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.2/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://ui.jquery.com/repository/latest/ui/ui.magnifier.js"></script>
the magnifier demo should work.

It's not so much a common problem with the library, but that there are a few bugs in JQuery UI's stable version that are fixed in the beta version, which is referenced in the src above.

Readable versions of involved Javascript.
http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js
http://ui.jquery.com/repository/latest/ui/ui.core.js
http://ui.jquery.com/repository/latest/ui/ui.magnifier.js
However, reading them probably won't do you much good.  You are better off reading the JQuery tutorials.
0
 
sh0eCommented:
I didn't mean bugs and fixed.  I meant changes and updated.  Some of the UI is still being in the process of being actively implemented.
0
 
gabrielPennybackAuthor Commented:
Sorry for being gone.  I'l check this out in the next day or two.
Thanks,
John
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now