[Original] php+ajax implements simulated Win file management system
//
This tutorial is original from this site, please indicate the source when reprinting
Author: www.drise.cn
Email:drise@163.com
QQ:271728967
//
The last file is the js.js file.
var xmlhttp=false;
function aa(obj)
{
obj.className='aa';
obj.onblur=function(){obj.className='bb';}
}
function resizepic(thispic) {
//$('imgbox').style.width = $('divbox').clientWidth;
if(thispic.height>55||thispic.width>55)thispic.style.zoom=56/(thispic.height>thispic.width?thispic.height:thispic.width);
}
function resizeimg(thispic){
if(thispic.height>100||thispic.width>100)thispic.style.zoom=180/(thispic.height>thispic.width?thispic.height:thispic.width);
}
The above are for scaling images. However, there seems to be a problem on Fox.
function Losefocus(obj,path){ //Here is to determine the legality of the file when creating the file, and then send the parameters to the rename.php file,
var ivalue=obj.value;
if( 'New folder' == ivalue || !ivalue.match(/^w{1,255}$/i)){
alert('Enter a legal folder name!');
obj.select();
return false;
}else{
CreateAjax();
var url="rename.php?path="+encodeURI(path.replace("/","/"))+"&nname="+encodeURI(obj.value)+"&action=mkdir&rd="+Math.random ();
Senddata('GET',url,ReturnValue,'mkdir');
document.getElementById('t1').innerHTML=ivalue;
window.location.reload();
}
}
I won’t write anything else today because my hands hurt. I’ll continue tomorrow.