This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function space(self) { | |
document.forms['form_name'].elements['form2'].value = Math.floor(self.value * 100) / 100; | |
} | |
</script> | |
<input type="text" name="form1" value="" onchange="space(this);" /> | |
<input type="text" name="form2" value="" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img{ | |
max-width: 500px; /* 最大幅 */ | |
min-width: 200px; /* 最小幅 */ | |
} | |
/* | |
これつかえばimgが元のサイズで表示される | |
指定したimgが最大幅よりもあったとき、指定した最大幅で表示される | |
高さはmax-widthとmin-width | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imgCeter{ | |
display: block; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
<img src="hoge.jpg" class="imgCeter" /> | |
参考 | |
http://wayohoo.com/programming/css/how-to-center-the-img-tag.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="mailto:[email protected]?subject=【問い合わせ 】商品番号114514">お問い合わせはこちら</a> | |
<!-- | |
送信先 : [email protected] | |
件名 : 【問い合わせ 】商品番号114514 | |
となる | |
コンタクトフォームのほうがスマートかも | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zshでのエラーみたい | |
tabを押して候補を出そうとする出る | |
* lsは途中からエラーがでる | |
* cdとcatでエラーが出た | |
こういうときは.zcompdumpを削除してシェルを新しくするといいらしい | |
参考 | |
http://kaworu.jpn.org/freebsd/zsh_%E3%81%AEfunction_definition_file_not_found%E3%81%A8%E3%81%84%E3%81%86%E3%82%A8%E3%83%A9%E3%83%BC%E3%81%AE%E5%AF%BE%E5%87%A6%E6%B3%95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// カスタム投稿タイプの追加 | |
add_action( 'init', 'create_post_type' ); | |
function create_post_type() { | |
register_post_type( 'news', // 投稿タイプ名の定義 | |
array( | |
'labels' => array( | |
'name' => __( 'ニュース' ), // 表示する投稿タイプ名 | |
'singular_name' => __( 'ニュース' ) | |
), | |
'public' => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$view_arr = array("red", "green", "bule", "Yellow", "black", "white"); | |
$get_arr = array("bule", "Yellow", "black"); | |
foreach($view_arr as $v){ | |
foreach($get_arr as $v2){ | |
if($v === $v2){ | |
$temp = $v2; | |
echo '<input type="checkbox" name="hoge[]" value="'.$v.'" checked>'.$v; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$view_arr = array("red", "green", "bule", "Yellow", "black", "white"); | |
$get_arr = array("bule", "Yellow", "black"); | |
// 「in_array()を使えばもうひとつforeachを使わないくても済むのではと」というコメントを頂いたので修正 | |
foreach($view_arr as $val){ | |
if(in_array($val, $get_arr)){ | |
echo '<input type="checkbox" name="hoge[]" value="'.$val.'" checked>'.$val; | |
}else{ |
OlderNewer