Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / August 2003



Tip: Looking for answers? Try searching our database.

maintaining size ratio

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jarrod - 19 Aug 2003 13:30 GMT
Hi,

I am using contenteditable to resize div elements and I am wondering
if
there is a simple way to keep the size ratio?

Thanks,

Jarrod
Csaba2000 - 24 Aug 2003 19:16 GMT
How do you use contentEditable to resize div elements?
That attribute allows the user to change what's in the div, not resize it.
I'd be curious to hear more about what you are trying to do.

If you are asking whether there is a simple way to always have a fixed
number of lines in the div, then as far as I can tell the answer is no.
You could try units of "em" in your height specification, but even there
you should be careful.  You need at least 1.21em for one line
(else one line at smallest font size shows scroll bars) and at least 2.46em
for two lines.

Csaba Gabor from New York

> Hi,
>
[quoted text clipped - 5 lines]
>
> Jarrod
Jarrod - 26 Aug 2003 01:24 GMT
>How do you use contentEditable to resize div elements?
>That attribute allows the user to change what's in the div, not resize it.

You put a div tag around the div element that you want to edit.

<SCRIPT>
// Turn on 2D positioning
document.execCommand("2D-position",false,true);
</SCRIPT>
<DIV CONTENTEDITABLE="true">
<DIV style="width:300px;height:100px; background-color:red;
position:absolute;">
Movable DIV</DIV>
</DIV>

If the div isn't positioned absolutely, you can only change the size.

I read about that bit of code from the msdn site.

>I'd be curious to hear more about what you are trying to do.

Basically, I am trying to create a simple interface to use with an asp
image component that allows for cropping pictures. You will position a
div element over the area you wish to crop and the coordinates will be
posted to the aspimage page for processing. I have already done this,
but I was hoping to find a simpler solution.

Another issue with the resize ratio is when you resize pictures
dynamically in your page, they don't maintain the size ratio. I would
have thought that that would be a common function. I have not read
anything which documents a simple solution, hence my reason for
posting here.

Hope to talk to you again.

Jarrod
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.