Reply to Re: rounded corners without images

Your name:

Reply:


Posted by aaron.reese on 09/27/66 11:52

Toby Inkster wrote:

> This is a really horrible idea.


Why?, It seems to me to be quite an elegant solution.

It works without images so is not color dependant, is scalable, can be
contained inside another container div to precisely place it on the
page, does not require javascript which some users turn off, and as it
only uses CSS2 tags it should be browser independant. I agree that
writing in-line style sheets is not great, but you could farm quite a
lot of the setting to a REL style sheet and simply override the width
element in-line

I am going to write a PHP function and post it here (and cross post on
PHP boards - I know... but I need the feedback from them and they won't
see it here)

It will take the following arguments:-

divwidth - The width of the element to be contained
xradius - the length of the radius on the X- axis
yradius - the length of the radius on the Y-axis
fgcolor - the colour of the border
bgcolor - the colour of the background

I will then do the following:-

work out the difference between xradius and yradius and divide by
yradius to give me the radius-step.

then loop for yradius to 1

using pythagous theorem, I will calculate the length of the line to
fill the radius on the x axis.

X^2 * Y^2 = Z^2

I know Y becuase it is the loop counter, decreasing one pixel for each
line.

I know Z because it is yaxis + ((yaxis - loopcounter) * radius-step)

so I can calculate X. I have not worked out the anti-alaising yet.

end loop

I will then add 2 * the loop result to the divwidth and create a div
of this width

I suspect it will look dodgy with radius curves of less than 20px but
we will give it a go. I will post the whole function when it is
finnished.


If you wanted to try to keep layout separate from content, the
parameters for the function could always be included in an include file
which would allow you to set up different 'classes' of rounded corners


obiron

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация