javascript¿ØÖÆdivÐÅÏ¢¾ÓÖÐ
×î¾Ê¹ÓÃjquery.form.js×öÁËÒ»¸ö²éÑ¯Ò³Ãæ£¬ÔÚËÑË÷³ö½á¹ûºó£¬ÐèÒª·ÖÒ³£¬ÔÚ·ÖÒ³Öеã»÷ÏÂÒ»Ò³Ò³²ÅÓÃajaxÌá½»£¬ÔÚÌύûÓзµ»Ø½á¹ûÊÇÐèÒª¸ø¿Í»§ÏÔʾһÏÂÕýÔÚ¼ÓÔØÊý¾Ý£¬¹ÊÓÃjquery.1.3.2.js×öÁËÒ»¸öÐÅÏ¢ÌáʾµÄ½Å±¾¡£
´úÂëÈçÏ£º
<div id="loadProcess" style="z-index:1;visibility:hidden;width:300px;position:absolute;top:0px;left:0px;height:58px;border:1px solid #ccc;text-align:center;background:#fff;">
<ul>
<li></li>
<li><IMG height=9 src="../images/wait.gif" width=100></li>
<li></li>
<li>¡¾¡¡ÕýÔÚ¼ÓÔØÊý¾Ý...... ¡¿</li>
<li></li>
</ul>
</div>
½Å±¾´úÂ룺
function loadProcess(id){
var wnd = $(window), doc = $(document);
var left = doc.scrollLeft();
var top = doc.scrollTop();
//alert("scrollLeft:"+doc.scrollTop());
//alert("windowHeight:"+wnd.height());
left += (wnd.width() - $(id).width())/2;
top += (wnd.height() - $(id).height())/2;
//alert("top:"+top);
$(id).css("top",top);
$(id).css("left",left);
$(id).css("visibility","visible");
}
Ïà¹ØÎĵµ£º
ÀàµÄ¶¨ÒåÓÐ3ÖÖ»ù±¾·½·¨:
1¡¢´´½¨²¢ÄÜ·µ»ØÌض¨ÀàÐ͵ĶÔÏóµÄº¯Êý(¹¤³§º¯Êý)È磺
function wu()
{
var w=new object;
o.a=1;
return o;
}ÓÃÕâÖÖ·½Ê½´´½¨¶ÔÏó£ºvar u=wu();
2¡¢´´½¨¹¹Ô캯Êý£¬ÓÃnewʵÀý»¯ÀýÈ磺
function wu()
{this.a=1;}
ÓÃÕâÖÖ·½Ê½´´½¨¶ÔÏó: var u=new wu();
3¡¢ÔÐÍ·½Ê½,À ......
Definition and Usage
¶¨ÒåÓëÓ÷¨The constructor property is a reference to the function that created an object.
constructorÊôÐÔÊÇËù½¨Á¢¶ÔÏóµÄº¯Êý²Î¿¼Syntax
Óï·¨object.constructor
Example 1
¾ÙÀý
In this example we will show how to use the constructor property:
ÔÚÕâ¸ö¾ÙÀýÖÐÎÒÃǽ«Õ¹Ê¾ÈçºÎʹÓÃcons ......
¼¸¸ö±íµ¥ÑéÖ¤µÄ
function checkMail(obj,error)
{
if (obj == null)
return "NULL";
if (obj.value == "")
return "EMPTY";
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(obj.value))
return true;
else
alert(error);
return false;
}
......
<script>
function getCookieVal(offset) {
var endstr = document.cookie.indexOf(";",offset);
if(endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset,endstr));
}
function FixCookieDate(data) {
var ba ......