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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:57:51+00:00 2026-05-24T17:57:51+00:00

i am working with LightFace and it is working fine. i am fetching data

  • 0

i am working with LightFace and it is working fine. i am fetching data from server side and assign data into LightFace dialog but the problem is dialog’s height and width is not getting bigger according to the content size. so please guide me what i need to rectify in the code. i have given little part of my code. i need that the dialog should grow & shrink according to the content size. please guide me with little code. thanks

 var modal = "";
    var sHtml = "";

    jQuery.noConflict();
    jQuery(document).ready(function () {
        jQuery("#btnFeedback1").click(function () {
            var modal = new LightFace({
                draggable: true,
                height: 200,
                width: 300,
                title: 'My Profile',
                content: '<div class="BusyStyles"><div>',
                buttons: [
                { title: 'OK', event: function () {
                    if (Validate()) {
                        if (Save()) {
                            this.close();
                        }
                    }
                }
                },
                { title: 'Close', event: function () { this.close(); } }
            ]
            }).open();

            jQuery.ajax({
                type: "POST",
                url: "Dialog_LightFace.aspx/GetHtml",
                data: {},
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (data) {
                    sHtml = data.d;
                    modal.load(jQuery(sHtml).find('#frm').html())
                    //modal.load('<div css="BusyStyles"><img src="images/fbloader.gif" border="0" /><div>');
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert(textStatus);
                }

            });

            return false;
        });
    });
  • 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-24T17:57:51+00:00Added an answer on May 24, 2026 at 5:57 pm

    If you could, please try to make a JSFiddle with some sample code. It’s easier for us to debug.

    I think the problem is that you already open the dialogbox before you load in any content. Therefore, the dialogbox gets set on a width and height, before the content is determined.

    Try this:

    • Remove .open(); after making the var modal instance
    • Put this in jQuery.ajax.success:

      success: function (data) {
        sHtml = data.d;
        modal.load(jQuery(sHtml).find('#frm').html()).open();
      }
      

    If this is not helping, try to set width and height to 'auto' and see what happens.

    Edit

    Setting width and height programmatically:

    jQuery.ajax({
       type: "POST",
       url: "Dialog_LightFace.aspx/GetHtml",
       data: {},
       contentType: "application/json; charset=utf-8",
       dataType: "json",
       success: function (data) {
         var sHtml = data.d;
    
         // Get the element and dimensions
         var element = jQuery(sHtml).find('#frm');
         var width = element.width();
         var height = element.height();
    
         var modal = new LightFace({
           // all other options plus:
           width: width,
           height: height
         });
         modal.load(element.html()).open();
       },
       error: function (XMLHttpRequest, textStatus, errorThrown) {
         alert(textStatus);
       }
    });
    

    This code might need a little tweaking, because I’m writing this directly, but this illustrates how it should be able to work.

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

Sidebar

Related Questions

Working with SQL server with isolation level read committed snapshot, we routinely write data
Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB.
Working on calling a C function from my asm project. I'm trying to push
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,
Working example: http://alpha.jsfiddle.net/gTpWv/ Both of the methods work separately, but once regexp for smilies
Working SQL The following code works as expected, returning two columns of data (a
Working with COM interop, I can call a managed function from within unmanaged code.
Working on a legacy application at the moment and we are replacing the data
Working live URL showing problem: http://69.24.73.172/demos/newDemo/test.html The HTML : <div class="small-vote"> <a href="#" class="s
Working with phoneGap implementing drawing with Canvas. The catch we've run into is that

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.