2015年9月23日

WordPress 上一頁 下一頁的按鈕語法

<?php previous_post_link( '%link', '<div class="nav-previous">&larr; %title</div>', TRUE, ' ', 'portfolio_category' ); ?> 
<?php next_post_link( '%link', '<div class="nav-next">%title &rarr;</div>', TRUE, ' ', 'portfolio_category' ); ?> 
如果是 Custom Post Type 要把 slug 填入 portfolio_category 的地方
寫在 single.php 或 single-portfolio.php

2014年12月21日

Responsive text align center

電腦版想靠右對齊的文字,手機版想要置中對齊,這類的文字對齊,Bootstrap 並沒有內建這種功能,不過網路上早已經有解答!

https://github.com/twbs/bootstrap/issues/11292

2014年2月25日

CSS3 在所有 target blank 的連結後添加圖示

清楚的 UI ,在外連的連結後面加入圖示
/*
1. 注意 hover 合併 after 的寫法,不可調換
2. 注意加內容文字,又加入圖片的 content 寫法
3. 這樣寫也可以 a[target="_blank"]:after 
*/

a[target]:after{
   content: "(" url('../images/external_link_bk.png') ")";
}
a[target]:hover:after{
   content: "(" url('../images/external_link_red.png') ")";
}

2013年8月23日

純CSS下拉選單

<ul>
<li><a href="#">最新資訊</a>
<ul>
<li><a href="#">器材介紹</a></li>
<li><a href="#">購買指南</a></li>
<li><a href="#">產品評測</a></li>
</ul>
</li>
</ul>







.nav {
background-color:#000;
}
.nav ul{
list-style-type: none;
padding:0px;
margin:0px;
}
.nav li{
display: inline-block;
margin: 0px 10px;
position: relative;
}
.nav a{
color:#FFF;
text-decoration: none;
line-height: 26px;
font-size: 14px;
}
.nav a:hover{
text-decoration: underline;
}
.nav ul ul{
position: absolute;
background-color:#000;
left:-10px;
width: 110px;
display: none;
}
.nav ul li:hover > ul {
display: block;
}

2013年4月15日

ActionScript 3.0 把物件移到最上層的語法

通常做拉動的拼圖或是連連看遊戲的時候,目前拉動的物件會被其他東西疊到或壓到,
因此我們需要取得目前畫面上最高層的index,再把我們拉動的物件設定為最高層,
這樣拉動的物件永遠在最上層,就沒有東西可以疊到了

function startDragHandler(e:MouseEvent):void {
  e.target.startDrag();
  setChildIndex(MovieClip(e.target), numChildren - 1);
}
mBox.addEventListener(MouseEvent.MOUSE_DOWN, startDragHandler);
mCircle.addEventListener(MouseEvent.MOUSE_DOWN, startDragHandler);
mStar.addEventListener(MouseEvent., startDragHandler);

ActionScript 3.0 載入mp3和停止音樂

//建立聲音頻道物件
var soundChannel : SoundChannel;
//建立聲音物件
var sound : Sound = new Sound();

//先確定聲音載入完畢,之後再播放出聲音
sound.addEventListener( Event.COMPLETE, soundLoaded );
sound.load( new URLRequest("mymp3.mp3") );
function soundLoaded(e:Event) : void
{
 soundChannel = sound.play();
}

//停止聲音播放的按鈕
stopButton.addEventListener( MouseEvent.CLICK, stopButtonClick );
function stopButtonClick(e:MouseEvent) : void
{
 soundChannel.stop();
}

2013年3月26日

網頁常用的HTML符號代碼

© 版權所有 Copyright
&#169; 或是 &copy;

® 註冊商標 Registered
&#174; 或是 &reg;

▲ 黑色箭頭往上 BLACK UP-POINTING TRIANGLE
&#9650;

▼ 黑色箭頭往下 BLACK DOWN-POINTING TRIANGLE
&#9660;