Solved

Code that will produce a javascript magnifier

Posted on 2008-10-16
5
479 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:wilq32
wilq32 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

760 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

23 Experts available now in Live!

Get 1:1 Help Now