Solved

Code that will produce a javascript magnifier

Posted on 2008-10-16
5
480 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now