download
更改datetimepicker_css.js(版本Version: 2.2.2)
var StartYear =2010; //可以指定起始的年度 var imageFilesPath = "xxx"; //指定圖片路徑
var StartYear =2010; //可以指定起始的年度 var imageFilesPath = "xxx"; //指定圖片路徑
直接添加到網頁中。 程序代碼
JavaScript 語法:object.style.width="50px" 行內語法:style="width:20px" p { height:100px; width:100px; }段落屬性的設定
段落屬性的設定 利用這些設定可以輕易的控制字距、行高、縮排、凸排、水平對齊、垂直對齊等。這些性質對網頁設計的排版非常有用! 功能 : 設定文字行列高度 ( 可設單位屬性 : 點pt、英寸in、公分cm、像素px、百分比% ) 語法 : { LINE-HEIGHT : NORMAL︱( number )︱( length )︱( percentage ) } 範例 : {LINE-HEIGHT:10pt} 此性質可設定列高,可指定特徵字normal設為預設值,或指定含單位的長度值,或百分比(參照於父元件)均可。如line-height:3px,則設定列高為3px。
p.ex1 { font:15px arial,sans-serif; } p.ex2 { font:italic bold 12px/30px Georgia, serif; }
string str_pad ( string $input , int $pad_length [, string $pad_string= " " [, int $pad_type= STR_PAD_RIGHT ]] ) $input : 原字串 $pad_length : 補齊後的位數 $pad_string : 用來補齊的字串 $pad_type : 補齊的方式 有三種,STR_PAD_RIGHT (由右邊補)、STR_PAD_LEFT (由左邊補)、STR_PAD_BOTH (左右兩邊都補), 預設為STR_PAD_RIGHT $value = 7; //將數字由左邊補零至三位數 $value = str_pad($value,3,'0',STR_PAD_LEFT); echo $value; // 結果會印出 007;
1. 除IE外都可识别 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]}, controlHTML: '', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol" controlattrs: {offsetx:15, offsety:15}, //offset of control relative to right/ bottom of window corner anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
// the "i" after the pattern delimiter indicates a case-insensitive search if (preg_match ("/php/i", "PHP is the web scripting language of choice.")) { print "A match was found."; } else { print "A match was not found."; }認證IP是否正確
function validIP($ip){ return preg_match("/^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$/", $ip); }網站實例:
preg_match("/product[0-9]{4}.html/i",$_SERVER['REQUEST_URI']參考regular expressions
//副程式 function same_check(m_objc,objc){ if(m_objc){ $(objc).show("fast"); }else{ $(objc).hide("fast"); } } //jquery 主要的 $("#check").click(function(){ same_check($(this).is(":checked"),"#cCArea"); })
案例:只有兩個checkbox ,從中2選一。 if($("#cch2").attr("checked")){ $("#cck1Area").show("fast"); $("#cck2Area").hide("fast"); }
$dir = '/tmp'; array scandir(string directory[,int sorting_order] 注:sorting_order 預設為1 $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2);列出資料夾裡面的組成:glob
格式:glob($pattern); glob('*.txt'); //只會取得txt附檔名的檔案檔案之複製、刪除、更名
$file = 'example.txt'; $newfile = 'example.txt.bak'; if (!copy($file, $newfile)) { echo "failed to copy $file...\n"; }copy 的權限錯誤,只要把資料夾的write打開即可解決。 錯誤範例: Warning: copy( ) [function.copy]: failed to open stream: Permission denied int unlink ( string filename );
$number = strpos($filename,"."); $file_body = substr($filename,0,$number);
<input type='button' onclick='javascript:window.history.back()' value='哈哈' />
self.location='目標網址';
<script type="text/css"> .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } .ui-timepicker-div dl { text-align: left; } .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; } .ui-timepicker-div td { font-size: 90%; } .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } </script>2012/09/26 新增
<script src='../script/jquery-1.8.0.min.js'></script> <link rel="stylesheet" href="http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery-ui.css" type="text/css" media="all"> <script src="../script/jquery.ui.core.js"></script> <script src="../script/jquery.ui.widget.js"></script> <script src="../script/jquery.ui.datepicker.js"></script> <script> $(function() { $( "#datepicker" ).datepicker(); }); </script>
<script language="javascript" type="text/javascript" charset="utf-8" src="../script/datetimepicker2/datetimepicker_css.js"></script> <img src="../script/datetimepicker2/images/cal.gif" style="width:16px;height:16px;cursor:pointer;" border="0" alt="Pick a date" onclick="javascript:NewCssCal('order_pay_date','yyyymmdd','arrow',true,'24')"><small>按圖示即可輸入時間</small><input type="text" id="order_pay_date" name="order_pay_date" disabled="disabled">
function btn_editTime(auto){
var a=(new Date).getTime();
var own_path="../XXX.php?action=cc&a="+a;
$.get(own_path,{c_auto:auto}, function (data){
var XXX =data.00XX;
var YYY =data.00YY;
var $dialog = $("#showOneDetail").dialog({
title: 'Detail',
autoOpen: false,
bgiframe: true,
width: 450,
height: 420,
modal: true,
draggable: true,
resizable: false,
overlay:{opacity: 0.7, background: "#FF8899" },
buttons: {
'close': function() {
$(this).dialog('close');
}
}
});
//日期時間
$("#example16_start").val(XXX);
$("#example16_start_time").val(YYY);
$dialog.dialog('open');
// prevent the default action, e.g., following a link
return false;
},"json")
}
................ ........... ...........
$editBox=
var newwin = null; function opwin(news_id){ newwin=window.open('thron/issue-news.php?id='+news_id,'nw','width=680px,height=580px,resizable=yes,scrollbars=yes,status=0'); newwin.moveTo(200,10); } test
<SCRIPT LANGUAGE="JavaScript"> function closeMeAndReloadParent() { opener.location.reload(); window.close(); } <SCRIPT"> <body onunload='closeMeAndReloadParent()'>
<a href='xxx.php?id={$data[$i]['msnauto']}' onClick="opwin({$data[$i]['msnauto']});return false;" > function opwin(news_id){ newwin=window.open('xxx.php?id='+news_id,'nw','width=680px,height=680px,resizable=yes,scrollbars=yes,status=0'); newwin.moveTo(200,10); }
javascript: function doClose(){this.close();}
$(document).ready(function() { $("table") .tablesorter({widthFixed: true, widgets: ['zebra']}) .tablesorterPager({container: $("#pager")}); });20120928新增
$("#myTable").tablesorter({sortList: [[0,1]]} ) .tablesorterPager({container: $("#pager")});
$(document).ready(function() { $("table").tablesorter({ // pass the headers argument and assing a object headers: { // assign the secound column (we start counting zero) 1: { // disable it by setting the property sorter to false sorter: false }, // assign the third column (we start counting zero) 2: { // disable it by setting the property sorter to false sorter: false } } }); });針對table每頁幾行,進行優化 在紅色的兩個方塊本來是選上面20下面還是依然是10,優化的話,可以讓上面兩個同步。
BODY:
你的table資料
html, body {height: 100%; text-align: center;}
#container {
position: relative;
width:960px; height:100%;
margin:0 auto;/*ff 置中*/ *margin:0;/*ie 置中*/
text-align:left;
}
body > #container {height: auto; min-height: 100%;}
----------------------------------------------------------------------------
#container是最外層的div
var lite = FIND("menuLite" + x); var s = lite.style; s.pixelHeight = menu.menuHeight +(menu.menuBorder * 2); s.height = s.pixelHeight + 'px'; s.pixelWidth = menu.menuWidth + (menu.menuBorder * 2); s.width = s.pixelWidth + 'px'; if( menu.menuBgOpaque ) s.backgroundColor = menu.menuLiteBgColor; var body = FIND("menuFg" + x); s = body.style; s.pixelHeight = menu.menuHeight + menu.menuBorder; s.height = s.pixelHeight + 'px'; s.pixelWidth = menu.menuWidth + menu.menuBorder; s.width = s.pixelWidth + 'px'; if( menu.menuBgOpaque ) s.backgroundColor = menu.bgColor; s = menuLayer.style; s.pixelWidth = menu.menuWidth + (menu.menuBorder * 4); s.width = s.pixelWidth + 'px'; s.pixelHeight = menu.menuHeight+(menu.menuBorder*4); s.height = s.pixelHeight + 'px';
<!DOCTYPE HTML> <html> <head> <title>Title of the document</title> </head> <body> The content of the document...... </body> </html>meta 為utf-8 在 HTML5下可以縮減為:
書單:HTML5:建置與執行