[jQuery] Onwidow resize element width

[jQuery] Onwidow resize element width


Hey i am trying to create a plugin that changes the css of a div
according to size of window.
I cant use a % based layout because it causes a gap in the layout that
i dont like.
a small description of the script would be something like this:
windowwidth = 1000px
calculation = 1000(windowwidth) - 300 (this is for columns) / 150(this
is for child elemnts that fit div) = 4.66(answer from this sample
data)
if calculation = 4 (use integer only)
then element width = 600px
if calculation = 5
then element width = 752px
if calculation = 6
then element width = 904px
and so on.
I don't have much knowledge with writing my own scripts only the
basics of taking premade scripts and modifying them to my needs so if
someone can help me with this it will be much appreciated.
here is a tutorial that might be of help with this.
http://net.tutsplus.com/videos/screencasts/learn-how-to-create-a-jquery-plugin/
Thanks,
dP