Jump to content

getting Div's parameters


manix

Recommended Posts

Heya..

 

So what I need to do is I have a certain div with like 700px width unknown px height and unknown position (auto generated) and I need to place a textarea over that div with the same exact width height and position, how do I do that ?

 

I tried $(the div).attr('width') and height but it didn't rly work out :/

Link to comment
Share on other sites

This seems to indicate your using jquery is that true?

$(the div).attr('width')

 

And are you litterly using the div as selector or are you just using that as an example?

 

Another question which puzzles me is why would you want to have a textarea that is larger over a div element? I have my doubts if that might be a good idea, can you perhaps elaborate why you would want this?

Link to comment
Share on other sites

I managed, after taking a look at jquery api, erm I needed that because I'm creating an edit option to my site where users/admins can edit posts, meaning that the post is the div and when you click the edit button the textarea appears on top of it containing the text ^^ here're the functions if someone needs them:

 

$(selector).position().left

$(selector).position().top

$(selector).width()

$(selector).height()

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.