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");
}
Ïà¹ØÎĵµ£º
Çó 555.555µÄËÄÉáÎåÈë±£ÁôÁ½Î»Ð¡Êý
ʹÓÃMath.round Ôõô¶¼Ëã²»¶Ô,½á¹û¶¼ÊÇ555.55 ,Ã²ËÆÊÇÒòΪjava¼ÆË㸡µãÊýʱ»áĪÃûÆäÃîÔÚ½áβ¸úÉÏÒ»´®Êý×Ö ±ÈÈç555.55500000003
ÎÞÄÎÖ»ÄÜдÕâ¸ö·½·¨
function round(a,b){
var s=a.toString().indexOf(".");
a0=a.toString().substr(0,s+b+1);
a1=Math.round(a.toString().sub ......
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 ......
IE¿ÉÒÔµ÷Óãº
<script type="text/javascript">
// ˵Ã÷£º»ñÈ¡Ò³ÃæÉÏÑ¡ÖеÄÎÄ×Ö
// ÕûÀí£ºhttp://www.CodeBit.cn
function getSelectedText() {
if (window.getSelection) {
// This technique is the most likel ......
B.1 anchor¶ÔÏó
¡¡¡¡Ê¹ÓÃ<A NAME=>±ê¼Ç´´½¨µÄhtmlÃèµãÄܱ»Ò»¸öÁ´½Ó×÷ΪĿ±êÈç¹ûêµã°üÀ¨HREF=ÌØÐÔ,ÔòËüÒ²ÊÇÒ»¸öÁ´½Ó¶ÔÏó¡£
¡¡¡¡anchor¶ÔÏóÊÇdocument¶ÔÏóµÄÒ»¸öÊôÐÔ,Ëü±¾ÉíûÓÐÊôÐÔ·½·¨»òÕßʼþ´¦Àí³ÌÐò¡£
¡¡¡¡B.2 anchorsÊý×é
¡¡¡¡anchorsÊý×éÊÇdocument¶ÔÏóµÄÒ»¸öÊôÐÔ,ÊÇÎĵµÄÚËùÓÐanchor¶ÔÏóµÄÒ»¸öÁбíÈç¹ ......
ÐèÒªÒýÈëjquery-1.3.2.js
»ñÈ¡¿í¶È
function getCurrentWidth(){
var currentWidth = 0;
// handle IE 6
if ($.browser.msie && $.browser.version < 7) {
var scrollWidth = Math.max(
document.documentElement.scrollWidth,
docu ......