How to expand the Div Tag to left hand side when mouse button click on Left side of Div Tag
-
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?
-
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?
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
-
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
hi, Thanks for the reply. Can you please give me some example for function. Thanks and Regardds Chandrakanth
-
hi, Thanks for the reply. Can you please give me some example for function. Thanks and Regardds Chandrakanth
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