Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6980279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:59:43+00:00 2026-05-27T17:59:43+00:00

I am using a 3rd party script to add a zoom function to images

  • 0

I am using a 3rd party script to add a zoom function to images on a page. This works quite well with static, but not with dynamic content.

Static version, works:

$(document).ready(function(){ 
    $('#gallery_main_img').addpowerzoom();
})

Dynamic version, doesn’t work:

$(document).ready(function(){ 
    $('#gallery_main_img').load(OnGalleryImageChanged);
})

function OnGalleryImageChanged() {
    $('#gallery_main_img').addpowerzoom();
}

The addpowerzoom function is created with this code in the PowerZoom script, which is referenced in the <head> of my page:

$.fn.addpowerzoom=function(options){ 
    // function content here
}

When entering the event handler, Firebug gives me this error message:
$("#gallery_main_img").addpowerzoom is not a function.

So it seems to be a scope problem. My question is:

How do I access the addpowerzoom() function from within my event handler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:59:44+00:00Added an answer on May 27, 2026 at 5:59 pm

    If you check that 3rd party script’s source, the first thing you’ll notice it do is set jQuery in noConflict mode, with the code jQuery.noConflict() and it doesn’t assign it to a variable either, meaning the $ isn’t reserved for jQuery anymore.

    As you mentioned that the first case is working, I am presuming that you have the ready statement before you include the 3rd party script, because otherwise that wouldn’t work either.

    You could either change your code to this (replacing $ with jQuery):

    jQuery(document).ready(function(){ 
        jQuery('#gallery_main_img').load(OnGalleryImageChanged);
    })
    
    function OnGalleryImageChanged() {
        jQuery('#gallery_main_img').addpowerzoom();
    }
    

    example: http://jsfiddle.net/niklasvh/8Vjnu/

    or wrap the code inside of a:

    (function($) { 
      $(function() {
        // more code using $ as alias to jQuery
      });
    })(jQuery);
    

    or perhaps remove the noConflict from the 3rd party script altogether (something that the author should have never put in there in the first place, unless they assume that everyone who use the script wants to remove jQuery from $).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how is this jquery app validating the username? (3rd party script) Iam using the
This is driving me nuts. I am using some 3rd-party code in a Windows
i am using 3rd party api and this is what is its returning me:
We are using a 3rd party java script library for functionalities like drag-drop, calender
When using 3rd party libraries/components in production projects, are you rigorous about using only
I am using a 3rd party API which is defined in 2 DLLs. I
I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware
I am using a 3rd party component which creates settings files based on hard-coded
The project I'm on is using a 3rd party component to build dynamic PDFs
In my current project I am using a 3rd party library which has no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.