Build, share, and learn JavaScript, CSS, and HTML with our online code editor. Discover web applications and hire talent from the world’s largest community of front end developers and designers.
現在、A!@attripさん発で話題になっている「たった2行でIE5.5~IE8をモダンブラウザの挙動にする魔法のJS」という記事。 Webデザイン界隈では当たり前のものですが、実はもうひとつ追加しておくといいかもしれないjsがあったりします。 Photo:html5 By michael pollak IE8以前のブラウザはどうにもこうにも開発者泣かせなわけですが、ie9.jsとcss3-mediaqueries.jsを突っ込むことで、モダンブラウザと同じ挙動にすることができちゃいます。 もう少し具体的に書くと、ie9.jsを組み込むことで、 position:fixed;に対応 max-width、max-heightに対応 属性セレクタ、擬似クラスに対応 margin:0 auto;でのセンタリングに対応 透過PNGに対応 opacityに対応 といったことが可能になります。要はCS
Googleに認識されるパンクズとされないパンクズ 久々にコーディングの仕事を本格的にしているのですが、パンクズの重要性が気になる今日このごろ。 Googleの検索エンジンのロボットにパンクズとして認識されるパンクズと、そうでないパンクズがあることを割とさっき知りました。 Googleのロボットに認識されないパンクズ <ul> <li><a href="/">ITかあさん</a></li> <li><a href="/archives/category/html5マークアップ術">HTML5マークアップ術</a></li> <li>HTML5×CSS3ベースのPC版スマートフォン版共通テンプレート </li> </ul> Googleのロボットに認識されるパンクズ パンくずリスト – ウェブマスター ツール ヘルプ <a href="http://www.example.com/dress
<script type="text/javascript"> <!-- window.onload = function() { if (!document.createElement) return; var ele = document.createElement("div"); // 新規に要素(タグ)を生成 var str = document.createTextNode("あいうえお"); // 生成する要素の値(文字列) ele.appendChild(str); // 生成する要素の作成(要素に値を追加) document.body.appendChild(ele); // このページ (document.body) の最後に生成した要素を追加 } // --> </script> 既存のエレメント(要素)に別の要素を追加する場合は createElement() を使用
ある要素の直前に追加する(insertBefore) これまでのサンプルでは、要素を追加するところに、それを収容する要素が事前に準備されていました。しかし、あるタグ要素を追加したいときに、その追加したいタグを収容する要素がすでに存在しているとは限りません。そのような場合に役に立つのがinsertBeforeメソッドです。このメソッドは名前の通り、あるタグ要素の前に、新たな要素を追加するメソッドです。正確に言うと、親となるタグ要素があり、その直下の子要素のいずれかを指定し、その直前に新たな要素を追加します。 insertBeforeメソッドには2つの引数を与えて使います。1つ目は、新たに追加したい要素ノードオブジェクトです。2つ目は、追加したい要素の場所を表すために使う、直前の子要素のノードオブジェクトです。 次のサンプルを見て、具体的な使い方を見ていきましょう。 insertBefore.
getAttribute() は Element インターフェイスのメソッドで、この要素の指定された属性の値を返します。 指定された属性が存在しない場合、値は null か "" (空文字列)のどちらかになります。詳しくは属性が存在しない場合を参照してください。
Come creare il miglior gioco da casinò Quando si progetta un gioco da casinò, la prima cosa che devi considerare è che tipo di gioco sarà. Ci sono molti diversi tipi di giochi da casinò, dalle slot e video poker ai giochi da tavolo e giochi di carte. Dovrai decidere quale tipo di gioco si adatta meglio alle tue esigenze. Ogni tipo di gioco ha il proprio set di regole e regolamenti, quindi dovrai a
window.open()で小窓 いわゆる小窓です。これはJavaScriptの window.open() というメソッドで 小窓となるウィンドウを生成します。 各引数の文字列は一重引用符または二重引用符で括って指定します。 第1引数「URL」は生成されるウィンドウに表示するページのURLです。 ※ ウィンドウに表示するページ(別のファイル)は別途作成して用意しておきます。 第2引数「ウィンドウ名」は特に指定する必要がなければ null で良いでしょう。 ウィンドウ名を指定するときは引用符で括ります。 ※ null を指定するとウィンドウ名の設定されていない新規ウィンドウとなります。 (HTMLの属性 target="_blank" と同等です) 例: window.open('example.html', null); 第3引数「オプション」はウィンドウの特徴を設定する文字列です。 こ
色のサンプルです。 このようなRGBの16進数で色指定を行います。 「red」や「blue」のような英語でのコード指定も可能です。 このボックスにカラーコードを入れてボタンをクリックすると、 背景色が変化します。 いろいろと試してみてください。 なお、JavaScriptが使える環境でないと動きません。 背景色:
ホームページの項目やおすすめリンク集も次第に大きくなっていきます。プルダウンメニューに目次やリンク集を詰め込めば、ホームページもコンパクトになります。 【リスト】 <script language="JavaScript"><!-- function myGo(){ mySelect = document.myForm.myMenu.selectedIndex; location.href = document.myForm.myMenu.options[mySelect].value; } // --></script> <form name="myForm"> <select name="myMenu"> <option value="index.htm" >☆☆ イヌでもわかるJavaScript講座 目次 ☆☆ <option value="hajimeni.htm">はじめに <
HOME JavaScript入門 location.href(リンク) ここから、リンク関係のJavaScriptについて解説していきます。 まず始めは、普通にリンクを貼る方法です。 <a href="">と動作は同じです。 FORMのボタンにリンク指定したりする場合に使います。 location.hrefの記述 別ページに移動するには、以下のように記述します。 location.href="URL" 指定したURLへジャンプする <script> function jump(){ if (confirm("トップページに戻りますか?")==true) //OKならTOPページにジャンプさせる location.href = "https://www.pazru.net/"; } </script> <input type="button" name="link" value="TOPへ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く