How to Zoomin from clientside

Last post 05-09-2008 6:47 AM by niradhip. 2 replies.

Sort Posts:

  • How to Zoomin from clientside

    05-09-2008, 5:30 AM
    • Loading...
    • niradhip
    • Joined on 04-30-2007, 7:24 PM
    • Posts 8

    I am designing a layout for a floor. I want to include zoom in and zoom out feature  from client side.I have a div and i made position = absolute,to give my lay out proper looks. I am calling a java script function for zoomin and zoomout. If I remove the position it is Zooming but with position= absolute it is not zooming.But  in my case position= absolute is important for looks. So anybody tell me how to ZOOM in from client side when position= absolute is activated.

     

     

    My java script function is as follows:

     

    function zoomin(){

    if(parent.parent.document.body.style.zoom!=0)

    parent.parent.document.body.style.zoom*=1.2;

    else

    parent.parent.document.body.style.zoom=1.2;

    }

     

    My .cs code is as follows:

     

     

    string strSQL = "SELECT bdm_txt_BuildingType, bdm_txt_Caption, bdm_num_Left, bdm_num_Top,bdm_num_Length, bdm_num_Breadth, bdm_num_FontSize FROM BuildingDimensions WHERE bdm_num_PartId = " + Session["Id"] + " ";

    DataSet dstData = new DataSet();

    objDataAccess.GetDataSet(ref dstData, strSQL, "Event");

    for (int intIndex = 0; intIndex < dstData.Tables["Event"].Rows.Count; intIndex++)

    {

    dblBuildLeft =
    Convert.ToDouble(dstData.Tables["Event"].Rows[intIndex]["bdm_num_Left"]) * 38 * 0.0576;dblBuildTop = Convert.ToDouble(dstData.Tables["Event"].Rows[intIndex]["bdm_num_Top"]) * 38 * 0.0576;

    dblBuildTop = dblBuildTop + 45;

    dblBuildWidth = Convert.ToDouble(dstData.Tables["Event"].Rows[intIndex]["bdm_num_Length"]) * 38 * 0.0576;

    dblBuildHeight = Convert.ToDouble(dstData.Tables["Event"].Rows[intIndex]["bdm_num_Breadth"]) * 38 * 0.0576;

    strCaption = dstData.Tables["Event"].Rows[intIndex]["bdm_txt_Caption"].ToString();

    hidSecLBreadth.Value = hidSecLBreadth.Value + "<table cellpadding='0' cellspacing='0' border='0' width='1250' height='100'><tr><td>";

    hidSecLBreadth.Value = hidSecLBreadth.Value + "<DIV id='div2'style = 'BORDER-RIGHT: 1px solid;BORDER-TOP: 1px solid;BORDER-LEFT: 1px solid;BORDER-BOTTOM: 1px solid;";

    hidSecLBreadth.Value = hidSecLBreadth.Value + " position:absolute; width:" + dblBuildWidth + "px; height:";

    dblTotalWidth =+ dblBuildWidth;

    hidSecLBreadth.Value = hidSecLBreadth.Value + dblBuildHeight +
    "px; z-index:4; left: " + dblBuildLeft;

    hidSecLBreadth.Value = hidSecLBreadth.Value + "px; top: " + dblBuildTop + "px; background-color:#C0C0C0;";

    hidSecLBreadth.Value = hidSecLBreadth.Value + " layer-background-color: #C0C0C0'><center><font size= " + intFontSize + ">" + strCaption + "</font></center></DIV></td>";hidSecLBreadth.Value = hidSecLBreadth.Value + " <td width='50%' ></td></tr></table>";

    }

    I am displaying the hidSecLBreadth.Value into a label in .aspx page.

  • Re: How to Zoomin from clientside

    05-09-2008, 6:13 AM
    • Loading...
    • blodfox777
    • Joined on 07-12-2007, 12:30 PM
    • Posts 63

    Hi

    I suggest to use ResizableControl, It seems meet your needs.

    Hope this helps Smile

    http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ResizableControl/ResizableControl.aspx

    Regards!
    Lance
    -- "Mark As Answer" If my reply helped you --
  • Re: How to Zoomin from clientside

    05-09-2008, 6:47 AM
    • Loading...
    • niradhip
    • Joined on 04-30-2007, 7:24 PM
    • Posts 8

    It's not working actually. In my layout the dimensions are coming from database and with the help of DIV I am displaying it. I use position:absolute in my DIV because then only I am geting proper looks and with this I cant able to zoomin.If I remove position:absolute I can avle to zoomin but all the blocks is comin in single column. Which hazard the layout plain. How to resolve it.

    Please help me.

    Regards,

    Niradhip

Page 1 of 1 (3 items)