Input
Note
The length of the input bar is determined by the content,and use 12 columns to control the length
In most cases, our default name is right-aligned and the input fields are left-aligned
Batch Upload
+
var flieList = [];
function analysisList(e,obj){
if( obj.length<1 ){
return false;
}
for( var i=0;i<obj.length;i++ ){
var fileObj = obj[i];
var name = fileObj.name;
var itemArr = [fileObj,name];
flieList.push(itemArr);
var filenamehtml = '<div class="file-name-box file-new"><label class=" control-label text-left no-padding"><span class="files_name"><a>'+name+'</a></span><span class="files-del"><i class="tk-icon a-icon icon-tk-delete" onclick="delfiles(this)"></i></span></label></div>';
$(e).before(filenamehtml);
}
};
function delfiles(e){
if($(e).parents(".file-name-box").hasClass("file-new")){
var nul = $(e).parents(".file-new").index()-1;
flieList.splice(nul,1);
}
$(e).parents(".file-name-box").remove();
}
function addfile(obj){
var _this = $(obj).parents(".upload-box")
analysisList(_this,obj.files);
}
$(".file-box").on("dragenter",function(){
$(this).addClass("borderd");
});
$(".file-box").on("dragover",function(){
$(this).addClass("borderd");
return false;
});
$(".file-box").on("dragleave",function(){
$(this).removeClass("borderd");
});
$(".file-box").on("drop",function(ev){
var fs = ev.originalEvent.dataTransfer.files;
var _this = $(this).siblings(".upload-box");
analysisList(_this,fs);
$(this).removeClass("borderd");
ev.preventDefault();
return false;
});
Different Width
Textarea
Textarea - Auto height
+
$(".text-auto-height").each(function(){
var descrollheighta = $(this)[0].scrollHeight + 2;
$(this).css("height",descrollheighta)
})
$(".text-auto-height").on("input",function(){
$(this).css("height","28px")
var descrollheight = $(this)[0].scrollHeight + 2;
$(this).css("height",descrollheight)
})
$(window).resize(function(){
$(".text-auto-height").each(function(){
$(this).css("height","28px")
var descrollheighta = $(this)[0].scrollHeight + 2;
$(this).css("height",descrollheighta)
})
})