WordPressを使ってサイト構築するとき、jQueryを使ってカスタマイズすることが多いと思います。 このサイトでもAjax+pushStateなどの技術を使うためにjQueryを多用しています。 WordPressでjQueryを使う じつはWordPressにはjQueryもパッケージされているので、自分のサーバーにjQueryを置いたりGoogleなどのCDNを読みこまなくても、header.phpに<?php wp_head(); ?>と書けば必要に応じて勝手に読み込まれます。 しかし問題があります WordPressにパッケージされているjQueryは、WordPressの独自仕様になっていて、ちょっと使いづらいんです。 具体的には、jQuery.noConflict();という関数が実行されていて(参考記事)、要はjQueryと似たような記法のjQuery以外のJavaSc
今回は、プラグインを使わないで作る『アコーディオンメニューの作り方』です! 例えば 『Q & A』みたいな項目に対しての説明が長くなってしまうとき 『メニューボタン』のように、入れ子入れ子で子ページがいくつもあるとき 説明が長い位場合は特に必要性を感じますよね。そのままつらつらと書き続けると、ユーザーがずっとスクロールしなくちゃいけなくて見るのが大変なのです。 そんな時に役立つのがこの『表示・非表示ボタン』です。 jQuery:クリックしたら 表示するtoggleボタンの実装方法 動作としてはこんな感じです。 表示(非表示)ボタンを押す ↓ ↓ ↓ 連動して、説明文が表示(非表示)になる 下にdemoも作ってあるので、触ってみてください。 demo HTML <!-- 表示ボタン --> <p class="openBtn"><i class="fa fa-chevron-down f
今日紹介する jQuery プラグイン[bxSlider]はレスポンシヴ・デザインにも対応した高性能なコンテンツ・スライダーです。 まずはサンプルをご覧ください。 jQuery bxSlider:サンプル・デモ 特徴は初心者でも簡単に設置できること、ファイル容量が小さい軽量設計、レスポンシヴ・デザイン対応で、各種スマートフォンやタブレットでも横幅に合わせてコンテンツのサイズを自動的に調整してくれること、また、画像だけでなく動画も含めた表示が可能、そしてオプション機能が豊富に用意されていることも大きな魅力の1つです。 実装方法は以下のとおり。 [bxSlider]の設置方法 最初に[bxSlider]の本体ファイルをダウンロードします。 リンクは以下より。 bxSlider:ダウンロード フォルダの中にいくつかのファイルが含まれていますが、基本的に必要なのはスクリプトの[jquery.bxs
レスポンシブ・デザインに対応したスライダーやスライドショー系のライブラリをまとめました。ほとんどがjQueryプラグインになりますが、中には単体で動くものもあります。オプション設定で多数のエフェクトの中から好みの動作のものを選択できたり、自動スライドやサムネイル表示やフリック入力に対応するなど、そのタイプも様々。 初心者の方でも上級者の方でも、目的に合ったjQueryスライダーを見つけられるはずです。 bxSlider 最初に紹介するのが[bxSlider]です。 設定が簡単で初心者にも扱いやすく、本当に初めてjQueryに触れるなら一番初めに試してみることをお勧めするスライダーです。 ただしカルーセル化するとレスポンシブ機能に不具合があるのが残念なところ。 ダウンロードURL
jQuery を使って、画像がフェードイン・フェードアウトで切り替わるシンプルなスライドショーを紹介します。 簡単に設置できることはもちろん、JavaScript、HTML、CSS がすべて短いコードで書かれているのが特徴です。 百聞は一見に如かず。まずはサンプルをご覧ください。 クロスフェードで切り替わるシンプルな画像スライドショー: サンプルデモ jQuery依存なので、まずはHTMLの <head>〜<head> 内でjQueryを読み込みます。 <head> <script src="/js/jquery.js"></script> <head> JavaScript の書き方$(function(){ // 設定 var $width =640; // 横幅 var $height =300; // 高さ var $interval = 3000; // 切り替わりの間隔(ミリ秒
Result jQuery//現在の年数オブジェクトを4桁で生成 var time = new Date(); var year = time.getFullYear(); //1900年まで表示 for (var i = year; i >= 1900; i--) { $('#year').append('<option value="' + i + '">' + i + '</option>'); } //1~12の数字を生成 for (var i = 1; i <= 12; i++) { $('#month').append('<option value="' + i + '">' + i + '</option>'); } //1~31の数字を生成 for (var i = 1; i <= 31; i++) { $('#day').append('<option value="'
【jQuery】ほんの少しのコードでページ読み込み時にフェードインのエフェクトを追加する方法。(改訂版) ウェブページ読み込み時に「フワっ」とした感じのエフェクトでフェードインしながら表示させる方法です。 ここでは「これ以上簡単にはできないよ!」というくらい、ほんの僅かなコードで実装するテクニックを紹介します。 まずは HTML の記述方法から…。と言いたいところですが、今回紹介する方法では何も考えずにフツーにHTMLを書いてしまっても大丈夫です。 スタイルシートも使いません。 すべてをjQueryのコードだけで賄います。 というワケでjQueryの記述方法です。 「fade.js」とでも名付けた JavaScript のファイルを用意して、その中に以下のように記述します。 $('head').append( '<style>body{display:none;}' ); $(window
例:jQueryのスライダー(jquery.bxSlider.min.js)を使うとき function my_scripts_method() { wp_enqueue_script('bxSlider', get_settings('site_url').'/wp-content/themes/your-theme/js/jquery.bxslider.min.js', array('jquery'), '4.1.2', true); add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); 複数のスクリプトを読み込むときはwp_enqueue_script()を併記します。 WordPress本体とは違うバージョンのjQueryを指定したいとき WordPress本体に含まれるjQueryのバージョンはバージョンアップとともに変
このドメインは お名前.com から取得されました。 お名前.com は GMOインターネットグループ(株) が運営する国内シェアNo.1のドメイン登録サービスです。 ※表示価格は、全て税込です。 ※サービス品質維持のため、一時的に対象となる料金へ一定割合の「サービス維持調整費」を加算させていただきます。 ※1 「国内シェア」は、ICANN(インターネットのドメイン名などの資源を管理する非営利団体)の公表数値をもとに集計。gTLDが集計の対象。 日本のドメイン登録業者(レジストラ)(「ICANNがレジストラとして認定した企業」一覧(InterNIC提供)内に「Japan」の記載があるもの)を対象。 レジストラ「GMO Internet Group, Inc. d/b/a Onamae.com」のシェア値を集計。 2023年5月時点の調査。
(追記/2011.12.02)ウィンドウをスクロールの際に、背景もズレてしまう不具合があったので、CSSとJavaScriptの一部を調整しました。 jQueryを使ってモーダルウィンドウを作成します。ウィンドウに表示するコンテンツはjQueryのAjaxで読み込むようにしています。 サンプルはこちら <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link
作成:2013/12/9 更新:2014/11/01 無料素材 > アプリを作るとき、クライアントさんのナビサイト、サービスを作るときにユーザーの満足度を上げれないか、使いやすく見やすく、コンバージョンを上げれないかと調べていたら、役に立ちそうなものが沢山ありました。今回はボタンやフォーム、ナビゲーションなどウェブサイトなどを使っていて楽しいと感じてもらうための素材やサンプルをcss/jQuery中心にまとめます。 エンジニア速報は Twitter の@commteで配信しています。 もくじ メニュー 1.円形 2.タブ 3.ナビゲーション 4.アコーディオン ウィンドウ 5.モーダルウィンドウ 6.フローティングウィンドウ 7.Dialog(ダイアログ) 8.フォーム+バリデーション ボタン 9.Toggle (トグルボタン) 10.Switch (スイッチボタン) 11.Scrubbe
スクリプトもスタイルシートも書かずに、多彩なアニメーションで画像がスライドするスライドショーを実装できるスクリプトを紹介します。 こういう実装方法がこれから増えてくるかもしれませんね。 Cycle.js Cycle.js -GitHub 対応ブラウザは下記の通り。 IE8+ Chrome Firefox Safari Opera TODOとして、ARIAのサポート、キーボード操作、IE7対応、エフェクトの追加を予定しているそうです。 いつもは、デモ、使い方、の順番で紹介していますが今回はデモと使い方を併せてご紹介。 Cycle.jsのセットアップ Cycle.jsのバリエーション Cycle.jsのセットアップ ベースとなるHTMLは非常にシンプルです。 スタイルシートをhead内に、スクリプトを</body>の上に外部ファイルとして記述します。 <title>Cycle.js</titl
MediaElement.js Plugins Boost your player with Chromecast, Google Analytics and more Look good. Sound good. MediaElement.js is a blazingly fast and amazingly powerful HTML5 audio and video library that creates a unified feel for media files (MP4, MP3), streaming content (HLS, M(PEG)-DASH), and embeddable players like YouTube, Vimeo, Twitch, DailyMotion, Facebook, and SoundCloud.
(注*2014年1月24日に公開された記事を再編集したものです。) jQueryの知識はほぼ必要なし! ホームページにスライドショーを10分で設置できる方法。 サイトのトップページや作品集にスラドショーをつけてみたいけど、ほどんどjavaやjQueryの知識がない! 「それにjQueryって面倒臭そうだし!」 けど、10分もあればスライドショーが完成します。 最初はコピペで大丈夫!ファイルをダウンロードしてHTMLとCSSにタグを少し追加すれば完成!さっそく簡単にスライドショーが設置できる方法を紹介します。 1.bxSliderサイトからファイルダウンロード bxSliderの公式サイト(http://bxslider.com/)に行き、右上の「Download」ボタンをクリックして必要なファイルをダウンロード。 ZIPファイルの中 この中から今回は3ファイルだけ ※心配ありません。上記の
wordpressはプラグインがたくさんあって便利です。しかし、個人的には安易にプラグインを使うのではなく、自作できるものは自作できるよう心がけています。 今回紹介するのは前からよく使われている方法ですが、プラグインで実装している人も多いようなので紹介します。自分で作った方が自由ですし、無駄に大きなファイルにならないのでいいかと思います。 今回はボタンが現れるパターンを3種類作ってみました。定番のフェードインして現れるものと、CSS3を使ったものがあります。まずはサンプルをご覧ください。 HTMLは全て同じです。 <a href="#" id="page-top1">上に戻る</a> 非常にシンプルです。 では、CSSとiQueryを1つずつ解説します。 1. フェードイン まずはとても有名なやつです。ある程度スクロールするとフェードインして現れます。CSSは次のようになります。サンプルは
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く