Solved

Code that will produce a javascript magnifier

Posted on 2008-10-16
5
484 Views
Last Modified: 2008-11-13
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
Comment
Question by:gabrielPennyback
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 18

Assisted Solution

by:Pawel Witkowski
Pawel Witkowski earned 200 total points
ID: 22735095
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
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 22743294
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
 
LVL 16

Accepted Solution

by:
sh0e earned 300 total points
ID: 22750351
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
 
LVL 16

Expert Comment

by:sh0e
ID: 22750362
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
 
LVL 1

Author Comment

by:gabrielPennyback
ID: 22833377
Sorry for being gone.  I'l check this out in the next day or two.
Thanks,
John
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question