Asp.netÖÐ×Ô¶¨Òå¿Ø¼þÒýÓÃjavascriptÖеÄÈÕÀú½Å±¾ÐĵÃ
×Ô¶¨Òå¿Ø¼þÖеÄÒ³Ãæ´úÂ룺
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="wcontrol.ascx.cs" Inherits="wcontrol" %>
<script type ="text/javascript">
function PopupCalendar(InstanceName)
{
///Global Tag
this.instanceName=InstanceName;
///Properties
this.separator="-"
this.oBtnTodayTitle="Today"
this.oBtnCancelTitle="Cancel"
this.weekDaySting=new Array("S","M","T","W","T","F","S");
this.monthSting=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
this.Width=200;
this.currDate=new Date();
this.today=new Date();
this.startYear=1970;
this.endYear=3010;
///Css
this.divBorderCss="1px solid #BCD0DE";
this.tableBorderColor="#CCCCCC"
///Method
this.Init=CalendarInit;
this.Fill=CalendarFill;
this.Refresh=CalendarRefresh;
this.Restore=CalendarRestore;
///HTMLObject
this.oTaget=null;
this.oPreviousCell=null;
this.sDIVID=InstanceName+"oDiv";
this.sTABLEID=InstanceName+"oTable";
this.sMONTHID=InstanceName+"oMonth";
this.sYEARID=InstanceName+"oYear";
}
function CalendarInit() ///Create panel
{
var sMonth,sYear
sMonth=this.currDate.getMonth();
sYear=this.currDate.getYear();
htmlAll="<div id='"+this.sDIVID+"' style='display:none;position:absolute;width:"+this.Width+";border:"+this.divBorderCss+";padding:2px;background-color:#FFFFFF'>";
htmlAll+="<div align='center'>";
/// Month
htmloMonth="<select id='"+this.sMONTHID+"' onchange=CalendarMonthChange("+this.instanceName+") style='width:10%'>";
for(i=0;i<12;i++)
{
htmloMonth+="<option value='"+i+"'>"+this.monthSting[i]+"</option>";
}
htmloMonth+="</select>";
/// Year
htmloYear="<select id='"+this.sYEARID+"' onchange=CalendarYearChange("+this.instanceName+") style='width:10%'>";
for(i=this.startYear;i<=this.endYear;i++)
{
htmloYear+="<option value='"+i+"'>"+i+"</option>";
}
htmloYear+="</select></div
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐĿǰ¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×î¶¥¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×î¶¥¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
ÉèΪÊ×Ò³ºÍÌí¼ÓÊղصÄJavascript´úÂ룬¼æÈÝÐÔ»¹¿ÉÒÔ£¬¸÷ÖÖÖ÷Á÷ä¯ÀÀÆ÷¶¼²âÊÔͨ¹ýÁË¡£
function addfavorite(){//¼ÓÈëÊÕ²Ø
if (document.all){
window.external.addFavorite("http://"+document.location.host+"/",document.title);
}else if (window.sidebar){
window.sidebar.addPanel(document.tit ......
<script language="JavaScript" type="text/javascript">
<!--
// ˵Ã÷£ºÓà JavaScript ʵÏÖÍøÒ³Í¼Æ¬µÈ±ÈÀýËõ·Å
// ÕûÀí£ºhttp://www.CodeBit.cn
function DrawImage(ImgD,FitWidth,FitHei ......
½ñÌìÒªÏò´ó¼ÒÍÆ¼ö9¿îºÜ°ôµÄ¿ÉÔÚÍøÒ³ÖлæÖÆÍ¼±íµÄJavaScript½Å±¾£¬ÕâЩÓÐȤµÄJS½Å±¾¿ÉÒÔ°ïÖúÄã¿ìËÙ·½±ãµÄ»æÖÆÍ¼±í£¨Ïß¡¢Ãæ¡¢±ý¡¢Ìõ…£©£¬ÆäÖаüÀ¨jQuery¡¢MooTools¡¢PrototypeºÍһЩÆäËüµÄJavaScript¿ò¼Ü¡£
Äú»¹¿ÉÒԲο¼ÒÔÏÂJavaScript/CSSÏà¹Ø½Ì³Ì¼°×ÊÔ´:
¡¶¾«Ñ¡30¸öÓÅÐãµÄCSS¼¼Ê ......
ÔÚjavascriptÖУ¬¶ÔÏóʵ¼ÊÉϾÍÊÇÒ»¸ö¹þÏ£±í£¬±ÈÈçÏÂÃæÕâ¸öuser¶ÔÏó£º
function user(n, a)
{
this.name = n;
this.age = a;
this.toString = function() {
return "Name:" + this.name + ", Age:" + this.age;
}
}
var u = new user("tom", 18);
for (var k in u) {
alert('key: ' ......