alicepa / curved-corner

Automatically exported from code.google.com/p/curved-corner
0 stars 0 forks source link

DIV width percentage #12

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When resizing window, and element width is set in percents, script is not 
resizing element.
For example, element width is set to 50%. When page is loaded, element 
width is correct, but if I resize window, element width not changing. 

Original issue reported on code.google.com by mshug...@gmail.com on 22 Nov 2009 at 9:51

GoogleCodeExporter commented 8 years ago
Might not be possible as we are drowning a VML object for rounded corner. Not 
sure if 
IE lets to resize it.
Possible solution is to write additional code for tracking window resze and 
resize the 
object accordingly

Original comment by rahnas on 25 May 2010 at 1:33

GoogleCodeExporter commented 8 years ago
Hi Guys, 

I have the same issue and I was forced to find out a fix. 

So for a quick fix you could update the window_resize() function by adding the 
following line as the last line of the for instruction block:

el.vml.style.width = el.clientWidth; 

, which will update the width with its value in pixels not in percent. The 
percent walue it's ignored, that's why the element is not resized.

Cheers, 
Catalin.

PS: It would be nice to have a new revision of the border-radius.htc script ;)

Original comment by catalin....@gmail.com on 25 Apr 2011 at 12:29

GoogleCodeExporter commented 8 years ago
Working on a new version which eliminates the need for the resize handler. 

There are a few other issues with using this method, including dynamic changes 
in the dimensions of a target element won't update the VML objects.  

v4, instead of using a resize handler, appends the RECT/FILL onto the target 
element -- if the target element is static positioned, sets it to relative... 
change RECT so it uses position absolute with 100% width/height.  Now when the 
div changes, the rect will change with it, without running through an entire 
loop of all the elements every time the browser resizes.... which is cause for 
an insane amount of performance hits.

Original comment by tyler.wa...@gmail.com on 2 Oct 2011 at 9:06