2011年12月28日 星期三
相當於FLASH的XY軸
$('#xxx').offset().left
$('# xxx ').offset({ top: 10, left: 30 });
jquery 視窗寬高度
alert($(window).height()); //瀏覽器當前窗口可視區域高度 alert($(document).height()); //瀏覽器當前窗口文檔的高度 alert($(document.body).height());//瀏覽器當前窗口文檔body的高度 alert($(document.body).outerHeight(true));//瀏覽器當前窗口文檔body的總高度 包括border padding margin alert($(window).width()); //瀏覽器當前窗口可視區域寬度 alert($(document).width());//瀏覽器當前窗口文檔對像寬度 alert($(document.body).width());//瀏覽器當前窗口文檔body的高度 alert($(document.body).outerWidth(true));//瀏覽器當前窗口文檔body的總寬度 包括border padding margin資料來源http://chaowei.wordpress.com/2011/04/15/jq-%E5%8F%96%E5%BE%97%E5%BC%8F%E7%AA%97%E9%AB%98/
2011年12月22日 星期四
function裡藥用外部變數要在裡面加global
function for_count_use(){
global $count_title;//要用外部變數要這樣用
$count_title++;
echo $count_title;
}
php 絕對位置
$root_Path=$_SERVER['DOCUMENT_ROOT'].'/Houli/';
//HTML用的連結時的絕對路徑
$root_Path_html="http://localhost/Houli/";
//include時要用$root_Path(D:wamp/www/xxxx) ,src的HTML用法要$root_Path_html
2011年12月20日 星期二
2011年12月5日 星期一
偵測是否IPAD
//返回boolean值 True 或者 False
function is_IPhoneOrIPad(){
return ( (navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPad") != -1) );
}
IE8無法吃JQUERY $無法定義或NULL
Check your script include tag,
change totype="text/javascript" src="/path/to/jquery"
2011年11月27日 星期日
JQUERY attr屬性一直記不起來
alt: 'Beijing Brush Seller',
title: 'photo by Kelly Clark'
});
2011年11月25日 星期五
array用法
$i=0;
do {
$mealsArray[i]=array();
$mealsArray[i]=$row_RecNews;
}while()
left join式看看
2011年11月21日 星期一
上傳限制2M
max_execution_time = 30000 ; Maximum execution time of each script, in seconds(30s)
max_input_time = 60000 ; Maximum amount of time each script may spend parsing request data(60s)
memory_limit = 1024M ; Maximum amount of memory a script may consume (8MB)
post_max_size = 1024M ; Maximum size of POST data that PHP will accept.(8MB)
upload_max_filesize = 1024M ; Maximum allowed size for uploaded files.(2MB)
phpmyadmin改cookie
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
#一定要照上面改不然會不能啟動apache
2.C:\wamp\phpmyadmin找config.inc.php
改成這樣
$cfg['blowfish_secret'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
2011年11月9日 星期三
篩選文章分類並POST出該分類所有文章
<?php query_posts('category_name=special_cat&posts_per_page=10'); ?>
<?php while (have_posts()) : the_post(); ?>
<!-- Do special_cat stuff... –>
<?php endwhile;?>
來源:
http://codex.wordpress.org/The_Loop
出現特色圖片
在 主題編輯器下 (theme editor) 的 function.php 中加入下列一行 PHP 指令, 即會跑出 "設定特色圖片" 選項了!
add_theme_support('post-thumbnails');
使用方式
在使用頁面上
<?php the_post_thumbnail('featured-small'); ?>
來源
http://yinung2.blogspot.com/2010/12/wordpress_15.html
2011年10月27日 星期四
鎖圖拖曳以及右鍵
ONCONTEXTMENU="window.event.returnValue=false"//是鎖住右鍵選單功能
onSelectStart="event.returnValue=false"//是鎖住滑鼠選取(反白)功能
//對付firefox拖曳取圖招式
$(".post-body p img").mousedown(function(e) {
e.preventDefault();
})
//方法將通知Web 瀏覽器不要執行與事件關聯的默認動作(如果存在這樣的動作)。例如,如果type 屬性是"submit",在事件傳播的任意階段可以調用任意的事件句柄,通過調用該方法,可以阻止提交表單。注意,如果Event 對象的cancelable 屬性是fasle,那麼就沒有默認動作,或者不能阻止默認動作。無論哪種情況,調用該方法都沒有作用。
2011年10月26日 星期三
2011年10月18日 星期二
抓取一個div裡的第3張img 以及 取得eq有幾個數量
$(".post-body p img").length
2011年10月13日 星期四
取消物件滑鼠行為(蓋在上面的物件取消滑鼠偵測)
pointer-events:none;
IE很SUCK不行用
就跟AS3的
mouseEnabled=false;
mouseChildren=false;
的效果依樣
2011年10月11日 星期二
2011年10月8日 星期六
AR RESEARCH
http://words.transmote.com/wp/flarmanager/
http://words.transmote.com/wp/20100520/flarmanager-for-flarenft/
http://www.imagination.at/en/?Products:Augmented_Reality_for_Flash:flare%2Anft
flartool kit
http://groups.google.com/group/flartoolkit-userz/browse_thread/thread/9419dc4cf73f740d?pli=1
http://saqoo.sh/a/
http://www.libspark.org/wiki/saqoosha/FLARToolKit/en
me
http://work.goods-design.com.tw/
2011年9月26日 星期一
2011年9月24日 星期六
如果出現發佈安裝錯誤
Could not generate timestamp: handshake alert: unrecognized_name
AIR setup creation FAILED.
Troubleshooting:
- did you build your project in FlashDevelop?
- verify AIR SDK target version in application.xml
Press any key to continue . . .
請移除java7試看看
2011年9月8日 星期四
2011年9月7日 星期三
wordpress 中猴事件簿
但是Imbalance 版本又要用advanced-excerpt
所以目前只好將Imbalance 2獨立一個WP
不能用在mu WP下了 QQ
一定要掛外掛FaceBook Share (New)
get_the_content才會全域可以使用???
但FaceBook Share (New)太醜我用style display:none了
2011年9月1日 星期四
2011年8月4日 星期四
圖片置換 滑鼠移入
STEP1 HTML
<a href="#"><div id="fbicon"><img src="img/fb.png" width="25" height="24" /></div></a>
STEP2 CSS
#fbicon {
float:right;
width:25px;
height:24px;
background-image: url(../../../img/fb_over.png);
}
STEP3 JQUERY
//圖片置換 滑鼠移入
function picover(hit_area){
$(hit_area).hover(function() {
$(hit_area+' img').hide();
},
function(){
$(hit_area+' img').show();
})
}
picover('#fbicon ');//這裡就只要用到的地方就加一行
2011年8月3日 星期三
li子層 寬度 比父層 寬 時不要設定overflow: hidden;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<style>
* {
margin:0px;
padding:0px;
list-style-position:none;
list-style-type:none;
float:none;
}
#content {
width:500px;
}
#content ul{
width:500px;
}
.level1{
width:80px;
float:left;
list-style-type: none;
}
.bg{
width:50px;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.level1 {
background-color: #FC0;
}
.level2 li {
width:150px;
background-color: #000;
color:#fff;
}
</style>
</head>
<body>
<div id="content">
<ul class="menu">
<li class="level1"><div class="bg"><a href="">work</a></div>
<ul class="level2">
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
</ul>
</li>
<li class="level1"><div class="bg"><a href="">news</a></div>
<ul class="level2">
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
</ul>
</li>
</ul>
</div>
</body>
<script language="javascript">
$(document).ready(function(){
$('.level1').hover(function() {
//$('#work ul').slideDown('slow');
$(this).children('.level2').show();
},
function(){
//$('#work ul').slideUp('slow');
$(this).children('.level2').hide();
}
)
/*
); */
})
</script>
</html>
///overflow: hidden; 取消這個即可
2011年8月2日 星期二
2011年8月1日 星期一
最基本的路徑概念
img/
以 / 開頭表示以伺服器下 找目錄wordpress 底下的img資料夾
/wordpress/img
2011年7月21日 星期四
透明PNG也可以當遮色片(透明區域不遮會不顯示,不透明區域遮到會顯示)
//mask區域
lumos_mask.filters = [new BlurFilter(0,0,0)]//給mask加上filter
//設定mask
lumos_pic.mask = lumos_mask;
2011年7月20日 星期三
AS3 跳外部連結navigateToURL
function opneNewPage(e:MouseEvent){
var targetURL:URLRequest = new URLRequest('http://tw.yahoo.com');
navigateToURL(targetURL , "_Blank");
}
2011年7月19日 星期二
BitmapData移動也可以平滑
var bitmap:BitmapData=new BitmapData(bg.width, bg.height);
bm = new Bitmap(bitmap);
bm.pixelSnapping = 'auto';
bm.smoothing = true;
//設定matrix來縮放原圖大小
//var matrix:Matrix = new Matrix();
//等比縮放
//var scale:Number = p_width / _ldr.content.width;
//matrix.scale(scale, scale);
//強致縮放
//var scaleX:Number = p_width / _ldr.content.width;
//var scaleY:Number = 44 / _ldr.content.height;
//matrix.scale(scaleX, scaleY);
//畫出來
//bitmap.draw(_ldr,matrix);
bitmap.draw(bg);
addChild(bm);
2011年7月1日 星期五
2011年6月27日 星期一
JQUERY綁定偵聽
$('#cutmap').unbind('mousedown', openMapGo);//移除綁定偵聽
function openMapGo(){
//dosomething
}
顯示瀏覽器及引擎名稱及版本
script type="text/javascript" src="js/jquery-1.6.1.min.js" /script
script type="text/javascript" src="js/jquery.browser.js" /script
$(function(){
// 顯示瀏覽器及引擎名稱及版本
$("#browsername").html(
'' + $.browser.name.replace('msie', 'Internet Explorer') + ' browser ' + $.browser.version + '.' + "
" +
'' + $.layout.name + ' layout engine ' + $.layout.version + '.'
);
alert($.browser.name.replace('msie', 'Internet Explorer'));
});
引用自
http://demonstration.abgne.tw/jquery/plugins/0055/0055.html
2011年6月26日 星期日
toggle()與toggle(fn,fn)切換開關用法
這樣寫就是 按一下content hide 再按一下content show
$("#content").toggle(function(){
第一次按下做啥事
},function(){
//當然可以第三個fm 第四個等等 會依序輪迴
2011年6月23日 星期四
for永遠記不住
trace(i);
}
這樣最後是12
for (var ix:Number = 12; ix > 0 ; ix-- ) {
trace(ix);
}
這樣最後是1
this['物件名' + '數字']
this['puzzle_' + '1'] //這樣即可取得該物件
this['物件名' + '數字']
FD的plugin與快捷鍵
Ctrl +0 產生trace
Duplicate-0.3_Plugin
Ctrl +D 重製
Ctrl +ALT+D 製會型重製
FDFlexFormatter_0.2
Ctrl + Shift + F 程式整理排列
Ctrl + Shift + 1 //自動匯入類別, 產生 Event Handler, Method override, 產生 Getter/setter, 自動宣告變數(或本地變數轉成類別變數), 實做介面方法...等等
Ctrl + B //插入 Snippet
Ctrl + Shift + K //插入色碼
-------------------------------------------
Ctrl + Shift + Space //出現程式碼提示
Ctrl + Alt + Space //類別提示
F1 //(提示區塊有 ... 時)展開訊息
F4 //尋找宣告(如在call function的地方按, 可以跳到該function)
Shift + F4 //從宣告返回(按了F4後回去用的)
Ctrl + D //游標所在行複製並貼上新行
Ctrl + Q //單行註解
Ctrl + Shift + Q //取消單行註解
Ctrl + Shift + F //程式碼收合
Ctrl + Shift + A //程式碼全部收合
Ctrl + Shift + E //程式碼全部展開
Escape: Hide the completion list or method call-tip.
F1: when you see "..." in a (yellow) tip, you can press F1 to see a more detailed tip.
F4: go to declaration of element at cursor location.
Shift+F4: jump back after F4 or code generation operations.
Ctrl+Space: contextual completion list - also, pressTab to expand snippets like 'for', 'while', etc.
Ctrl+Shift+Space: method call-tip (the yellow window with current method's signature)
Ctrl+Alt+Space: list all project classes (as after ':' or keywords like "new")
Ctrl+Shift+1:
contextual code generation
2011年6月21日 星期二
上傳檔案檔名中文一樣可上傳 for Windows
copy($_FILES[datafile][tmp_name][$j],'upload'.$Chinese_file_name);//複製暫存檔案到指定資料夾
Jquery取屬性值
_position = _this.position(),
_height = _this.height(),
_width = _this.width();
所以取left時
就是_position.left;
2011年6月20日 星期一
前往上一筆、下一筆資料
//RecNews 指定資料集
$colname_RecNews = "-1";
if (isset($_GET['news_id'])) {
$colname_RecNews = $_GET['news_id'];
}
mysql_select_db($database_connectPrince, $connectPrince);
$query_RecNews = sprintf("SELECT * FROM news WHERE news_id = %s AND news_active=1 ", GetSQLValueString($colname_RecNews, "int"));
$RecNews = mysql_query($query_RecNews, $connectPrince) or die(mysql_error());
$row_RecNews = mysql_fetch_assoc($RecNews);
$totalRows_RecNews = mysql_num_rows($RecNews);
//RecNewsAll 全部資料集 要把$row_RecNewsAll = mysql_fetch_assoc($RecNewsAll);;給註解掉才不會衝突
mysql_select_db($database_connectPrince, $connectPrince);
$query_RecNewsAll = "SELECT * FROM news WHERE news_active = 1 ORDER BY news_date DESC";
$RecNewsAll = mysql_query($query_RecNewsAll, $connectPrince) or die(mysql_error());
//$row_RecNewsAll = mysql_fetch_assoc($RecNewsAll);
$totalRows_RecNewsAll = mysql_num_rows($RecNewsAll);
//=======================================================
$id=$_GET['news_id'];
$ii = 0;
while($row = mysql_fetch_array($RecNewsAll)){
if($row["news_id"] == $id){
break;
}
$ii++;
}
//上一筆
if($ii > 0){
mysql_data_seek($RecNewsAll, $ii-1);
$row1 = mysql_fetch_array($RecNewsAll);
}
//下一筆
if($ii < mysql_num_rows($RecNewsAll)-1){
mysql_data_seek($RecNewsAll, $ii+1);
$row2 = mysql_fetch_array($RecNewsAll);
}
//=======================================================
2011年6月16日 星期四
FD 3.3.4用Flex SDK 4.5會報錯
"康派了"後會報錯 Error: unable to open 'libs/player/10.1/playerglobal.swc'
舉例
E:\Classes\flex_sdk_4.5.0\frameworks\flex-config.xml(56): Error: unable to open 'libs/player/10.1/playerglobal.swc'
就去E:\Classes\flex_sdk_4.5.0\frameworks\libs\player 下的10.2複製一個改名10.1解決
在FD使用trace的方法
Tools->Program Settings->FlashViewer->External Player Path
路徑選E:\Classes\flex_sdk_4.5.0\runtimes\player\10.2\win\FlashPlayerDebugger.exe
之後重開FD
COOL
開始大力trace
2011年6月8日 星期三
2011年5月31日 星期二
2011年5月24日 星期二
無所遁形
C:\Users\使用者\AppData\Local\Google\Chrome\User Data\Default\Cache
把裡面檔案清空,然後開始用chrome上網去你想要抓的網址
然後開始load影片後,裡面會有個檔案爆增大小,就是它
複製出來,然後改成可能的檔名,例如flv mp4 等等
2011年5月18日 星期三
2011年5月17日 星期二
2011年5月2日 星期一
CSS 版面自動高度
margin:0 auto;
width: 780px;
background: #ffc;
border: 1px solid #000;
overflow: hidden;
}
外層容器設定裡不要指定高度,也就是維持預設的 height:auto; 同時加入 overflow: hidden; 即可。
(當然內層容器也不要指定高度)
參考http://blog.linym.net/archives/129
2011年4月22日 星期五
2011年4月21日 星期四
CSS簡易HACK觀念
但如果拿掉那條屬性,又很賭爛,所以需求就是chrome要,IE7也要正常,
來!!首先知道 * (星符號)在chrome是無法判斷,但IE7可以接受*後面還有屬性設定
簡易範例 例如字型大小設定在chrome可以用75%但在IE7 用100%才正常
font-size: 75%;
*font-size: 100%;
這樣就會先讓chrome過了,再來IE讀到星號又變回100%
2011年4月20日 星期三
CSS-background-position的基本位移觀念
background: url(../img/Measure_css.jpg) no-repeat;
background-position : 0px -82px;(左右,上下,以左上角為基準點0px)
這裡位移觀念是以左上角為基準點0px
所以我一開始自以為這樣行的通結果失敗
background-position : top 82px;
or
background-position : left 82px;
目前這樣單用top left不是很明瞭
2011年4月6日 星期三
2011年2月20日 星期日
div簡單開關應用
<div id="open0<?php echo $row_Recp2c['faq_id']; ?>" style='display:;'><a href="javascript:View_resume(<?php echo $row_Recp2c['faq_id']; ?>)"><img src="img/Developer_Icons_002.png" width="15" height="15" border="0" /></a></div>
<script language="JavaScript">
//學校顯示全部關閉切換用
function View_resume(x){
if (eval("d0"+x).style.display == "") {
eval("d0"+x).style.display = 'none';
eval("close0"+x).style.display = 'none';
eval("open0"+x).style.display = '';
}else{
eval("d0"+x).style.display = '';
eval("close0"+x).style.display = '';
eval("open0"+x).style.display = 'none';
//開啟 x <div> 時要關閉 其它的 5 6 7 8 是維一的
switch(x){
// case 5:d06.style.display = 'none';d07.style.display = 'none';d08.style.display = 'none';break;
//case 6:d05.style.display = 'none';d07.style.display = 'none';d08.style.display = 'none';break;
//case 7:d06.style.display = 'none';d05.style.display = 'none';d08.style.display = 'none';break;
//case 8:d06.style.display = 'none';d07.style.display = 'none';d05.style.display = 'none';break;
}
}
}
</script>
![[PHP]使用Mail函式透過SMTP發信 [PHP]使用Mail函式透過SMTP發信](http://img2.sofree.cc/2011/PHPMailSMTP_7941/apache_smtp_1.png)