* auto set the fileform width.

This commit is contained in:
wangchunsheng
2010-01-19 08:37:08 +00:00
parent 71869b58b5
commit 2e600c8ba0
2 changed files with 15 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
<?php if($config->debug) echo '<div style="margin-bottom:50px"></div>';?>
<div class='yui-d0' id='hiddenbar'>
<iframe frameborder='0' name='hiddenwin' id='hiddenwin' class='<?php $config->debug ? print("debugwin") : print('hiddenwin')?>'></iframe>
</div>

View File

@@ -1,4 +1,16 @@
<div id='fileform'>
<?php for($i = 0; $i < $fileCount; $i ++):?>
<input type='file' name='files[]' />
<?php echo $lang->file->label;?><input type='text' name='labels[]' class='text-3' /><br />
<input type='file' name='files[]' id="file<?php echo $i;?>" />
<label id='label<?php echo $i;?>'><?php echo $lang->file->label;?></label><input type='text' name='labels[]' class='text-3' /><br />
<?php endfor;?>
</div>
<script language='javascript'>
function setFileFormWidth()
{
totalWidth = Math.round($('#fileform').parent().width() * 0.9);
titleWidth = totalWidth - $('#file0').width() - $('#label0').width();
if(!$.browser.mozilla) titleWidth -= 10;
$('#fileform .text-3').css('width', titleWidth + 'px');
};
$(function(){setFileFormWidth()});
</script>