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

  • Home
  • SEARCH
  • 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 8911675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:00:27+00:00 2026-06-15T04:00:27+00:00

This is the code I have (so far). I have had success with directly

  • 0

This is the code I have (so far). I have had success with directly alerting the values from the large image url. I want to be able to return the values as an object to another variable but have had no success. What am I doing wrong?

$.fn.extend({
        getBgImage: function(callback){
            var path = $(this).css('background-image').replace('url', '').replace('(', '').replace(')', '').replace('"', '').replace('"', '');
            var tempImg = $('<img />');
            tempImg.hide(); //hide image
            tempImg.bind('load', callback());
            $('body').append(tempImg); // add to DOM before </body>
            tempImg.attr('src', path);
            $('#tempImg').remove(); //remove from DOM
        },
        jZoom: function(){
            var swide = $(this).children('.zimg').outerWidth(),
                shigh = $(this).children('.zimg').outerHeight(),
                large = $(this).attr('href');
            $(this).after('<div class="mousearea" style="width:'+swide+'px;height:'+shigh+'px;cursor:move;z-index:99;opacity:0;position:absolute;top:0;left:0;"></div>').parent('.zoom').after('<div class="large" style="background-image:url('+large+');"></div>');
            var limg = $(this).parent('.zoom').next('.large').getBgImage(function(){
                var y = $(this).height(), x = $(this).width();
                alert(x+' '+y); // this alerts the values as expected
                //return {x: x, x: y}; This is what I attempted to return the values
            });
//alert(limg.x); and this is where i check to see if the object are available but get undefined
        }
    });
    $(function(){
        $('.zoomme').each(function(){
            $(this).jZoom();
        });
    });

This is just a work in progress, mainly for the sake of doing it but would like to know where I have gone wrong so far.

Thanks in advance.

  • 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-15T04:00:29+00:00Added an answer on June 15, 2026 at 4:00 am

    You are assigning the return value of the bgImage function, and not the return value of the function you are passing as an argument to bgImage.

    Since the callback doesn’t actually get executed when you pass it, and is instead bound as a load handler, there is no way to get its return value at that point.

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

Sidebar

Related Questions

I have this code so far which perfectly but relies on there being a
This is what I have as far as code, it is in the first
So i have this code which makes a box, but want to make the
So far I have had success in implementing Game Center for my app. Authorizing
Has anyone had issues with this code... ABRecordRef person = ABAddressBookGetPersonWithRecordID (addressBook,recordID); I have
this is function.php of a wordpress theme that NOD32 says this code have a
I've used this code to have a like btn on my site: <iframe src=http://www.facebook.com/plugins/like.php?href=URL_OF_YOUR_WEBSITE&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=80&amp
Currently I have this code: <?php echo '<meta name=robots content=noindex>'; $arr = json_decode(file_get_contents(http://media1.clubpenguin.com/play/en/web_service/game_configs/ paper_items.json),true);
So I have this code here: <table> <tr> <td width=200px valign=top> <div class=left_menu> <div
Hi I have this code and it doesn't work, what am I doing wrong?

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.