Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to expand the Div Tag to left hand side when mouse button click on Left side of Div Tag

How to expand the Div Tag to left hand side when mouse button click on Left side of Div Tag

Scheduled Pinned Locked Moved ASP.NET
questionhelptutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ChandrakanthGaddam
    wrote on last edited by
    #1

    Hi, This is from Chandrakanth. i have one problem. I am using Mater Page . In that Master Page i have content Place Holder. That alignment of Content place holder is located under the Div Tag, align as a right side and position is vertical. My Question is when i click on the Left side of the div tag, that div tag sholud expand to lefthand side with width of 100% by showing all contenet. Initiallt it will show only few items positined as a vertical. can any one tell me how to go for that?

    A 1 Reply Last reply
    0
    • C ChandrakanthGaddam

      Hi, This is from Chandrakanth. i have one problem. I am using Mater Page . In that Master Page i have content Place Holder. That alignment of Content place holder is located under the Div Tag, align as a right side and position is vertical. My Question is when i click on the Left side of the div tag, that div tag sholud expand to lefthand side with width of 100% by showing all contenet. Initiallt it will show only few items positined as a vertical. can any one tell me how to go for that?

      A Offline
      A Offline
      Arindam Tewary
      wrote on last edited by
      #2

      You need to write an onclick event of that div and you need to set top and left property to the nes pixel location. ( I guess this top and left property comes in style property collection of the control as display comes under style property collection )

      Thanks, Arindam D Tewary

      C 1 Reply Last reply
      0
      • A Arindam Tewary

        You need to write an onclick event of that div and you need to set top and left property to the nes pixel location. ( I guess this top and left property comes in style property collection of the control as display comes under style property collection )

        Thanks, Arindam D Tewary

        C Offline
        C Offline
        ChandrakanthGaddam
        wrote on last edited by
        #3

        hi, Thanks for the reply. Can you please give me some example for function. Thanks and Regardds Chandrakanth

        A 1 Reply Last reply
        0
        • C ChandrakanthGaddam

          hi, Thanks for the reply. Can you please give me some example for function. Thanks and Regardds Chandrakanth

          A Offline
          A Offline
          Arindam Tewary
          wrote on last edited by
          #4

          Please check the following code which sets left and top hence you can see the code 'relocates' an existing div to 0,0 location of the browser.

          <script language="javascript" type="text/javascript">
          function relocate()
          {
          var id=arguments[0];
          var divObj =document.getElementById(id);
          divObj.style.top = "0px";
          divObj.style.left = "0px";
          }

          <form id="form1" runat="server">
          <div style="background-color:Red;top:500px; left:500px; position:fixed;" id="div1" onclick="javascript:relocate(this.id)">sample</div>
          </form>

          Hope it helps you,

          Thanks, Arindam D Tewary

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups