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 8969087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:32:38+00:00 2026-06-15T17:32:38+00:00

zoom: function ( element, scale ){…..}, init: function() { $(#book div img).live(‘dblclick’, function() {

  • 0
zoom: function ( element, scale ){.....},
init: function() {
    $("#book div img").live('dblclick', function() {
       ...
       $( "#slider" ).slider({
       ...
          slide: function( event, ui ) {
             //call function here
             zoom (element,ui.value);
          }
       });
    });
},

There are two function, zoom and the main function. The main function call zoom function to perform work, how ever, since it is not at the same level, the browser return the error of undefined function ‘zoom’ . How to fix this (Able to call zoom inside the slide:function)?

  • 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-06-15T17:32:39+00:00Added an answer on June 15, 2026 at 5:32 pm

    Store a reference to the this object in the outermost scope of your functions. Then call this.zoom() inside your callback:

    zoom: function ( element, scale ){.....},
    init: function() {
        // store a reference to the object these functions are being added to
        var that = this; 
    
        $("#book div img").live('dblclick', function() {
           ...
           $( "#slider" ).slider({
           ...
              slide: function( event, ui ) {
                 // use the var you made above to call zoom
                 that.zoom (element,ui.value);
              }
           });
        });
    },
    

    simplified example: http://jsfiddle.net/u5ZL3/

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

Sidebar

Related Questions

I wrote a function to zoom in a UIView using CGAffineTransformScale. After a 2x
How can I adjust the zoom level within the function if the geolocation is
I'd like to implement zoom function while Ctrl key is pressed. But the MouseWheel
I'm making simple image editor by C# winform. I'm trouble with make zoom function.
How can I select the src attr from the zoom span? $(.gallery span.zoom).click(function() {
I am trying to apply an inline-block style to an element (a div to
I have a two function that work only when i click on some element.
How can I block the zoom-function of the Internet Explorer 6?
I am using the visualisation arborjs and I am trying to implement the zoom-function.
$img = imagecreatefrompng(img/.$image); $w = imagesx($img); $h = imagesy($img); $pixelcount = 0; echo <div

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.