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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:50:03+00:00 2026-06-08T04:50:03+00:00

I make Jcrop inside .dialog() function. runs great, but i can’t pass my X

  • 0

I make Jcrop inside .dialog() function. runs great, but i can’t pass my X and Y, etc. values!

function “updateCoords” works, but i cant passe it values throe Ajax! Fire Bug say that variables that I want to passe throe POST are not defined, but “HOW!” – i define variables in function updateCoords()! XD

function open_original(gallery_id, image_name){
    $("#image_crop_canves").dialog({
        modal:true,
        width:634,
        height:741,
        buttons:{
            "SAVE":function(){
                $.ajax({
                    url: "send.php",
                    type: "POST",
                    data: "a=crop&x="+cx+"&y="+cy+"&w="+cw+"&h="+ch+"&gid="+gallery_id+"&id="+image_name,

                    success: function(){
                        $("#image_crop_canves").dialog('close');
                        window.location();
                    }
                });
            },
            "CLOSE":function(){
                $("#image_crop_canves").dialog('close');
            }
        }
    });

    $("#image_crop").html("<div id=\"image_holder_crop\"><img id=\"cropbox\" src=\"../../pics/gallery/" + gallery_id + "/original/" + image_name + "\" /></div>");

    $("#image_crop_canves").dialog('open');

    function updateCoords(c) {
        var cx = c.x;
        var cy = c.y;
        var cx2 = c.x2;
        var cy2 = c.y2;
        var cw = c.w;
        var ch = c.h;
    }

    $('#cropbox').Jcrop({
        aspectRatio: 140/360,
        onSelect: updateCoords,
        setSelect: [0, 0, 140, 360],
        minSize: [140, 360]
    });
}
  • 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-08T04:50:07+00:00Added an answer on June 8, 2026 at 4:50 am

    The problem is that you are declaring the variables in the updateCoords(c) function, but are trying to access them outside of that function. This is not possible. What you can do is declare those variables in the open_original(gallery_id, image_name) function ( before $("#image_crop_canves").dialog({ ... }) ) and then set their values from the updateCoords(c) function, this way the variables will be accessible within the specified object.

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

Sidebar

Related Questions

Make things as simple as possible, but no simpler. Can we find the solution/s
With make on linux, we can do things like: foo=$(shell /bin/bar) which runs the
I make a picture with phone (640*480) and put it inside uiimageview (300*300) with
I make navigation with pages but this code not work, what's the problem ?
With make , I can do a make -k to cause the compiler to
I make asynchronous call for same URL for multiple times, But the response came
Make's implicit rules are supposedly there to make writing Makefiles easier but, if my
make is not only useful for building your programming project, but it seems to
i'm using jCrop and CodeIgniter, trying to make an image uploader. So i have
I make this async webrequest call mutliple times(can be twice or thrice or even

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.