Results 1 to 3 of 3

Thread: Simple Image Panner and Zoomer - jQuery issue (can't use $ in scripts))

  1. #1
    Join Date
    May 2011
    Posts
    16
    Thanks
    1
    Thanked 1 Time in 1 Post

    Exclamation Simple Image Panner and Zoomer - jQuery issue (can't use $ in scripts))

    1) Script Title: Simple Image Panner and Zoomer v1.1

    2) Script URL (on DD):
    http://dynamicdrive.com/dynamicindex4/imagepanner.htm

    3) Describe problem:

    Any pages I add the image panner script it kills my jQuery scripts.
    Even on a simple page like the below.
    HTML Code:
    <html>
    <head>
    	<script type="text/javascript" src="js/jquery-min.js"></script>
    	<script type="text/javascript" src="js/imagepanner.js"></script>       	
    </head>
    <body>
    <script type="text/javascript">
    $(document).ready(function(){
    	});
    </script>	
    </body>
    </html>
    I get an error `$ is not a function`. This stops any jQueries from running at all.

    I can use jQuery instead of $, but I've written a lot jQuery script which uses $ and it would take a while to rewrite them all.

    Please help me with this as I'm having no luck solving this one myself.

    Thanks,

    Joe

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    In imagepanner.js comment out this line as shown:

    Code:
    /* Simple Image Panner and Zoomer (March 11th, 10)
    * This notice must stay intact for usage 
    * Author: Dynamic Drive at http://www.dynamicdrive.com/
    * Visit http://www.dynamicdrive.com/ for full source code
    */
    
    // v1.1 (March 25th, 10): Updated with ability to zoom in/out of image
    
    //jQuery.noConflict()
    
    var ddimagepanner={
    
    	magnifyicons: ['magnify.gif','magnify2.gif', 24,23], //set path to zoom in/out images, plus their dimensions
    	maxzoom: 4, //set maximum zoom level (from 1x)
    
    	init:function($, $img, options){
    		var s=options
    		s.imagesize=[$img.width(), $im . . .
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    JoeDaStudd (06-29-2011)

  4. #3
    Join Date
    May 2011
    Posts
    16
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default

    Wow something so simple, thanks a million.

    Excellent can someone please close this topic and mark as solved.

    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •