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
https://forums.phpfreaks.com/topic/247370-getting-divs-parameters/
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?

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()

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.