jQueryを使用して、サイトにフェードやスライド、表示・非表示、タイマーなどのアニメーション効果を取り入れるチュートリアルを紹介します。 Super-Easy Animated Effects with jQuery チュートリアルは英語ですが、使用する関数、ソース(HTMLとJavaScript)が必要最小限でまとめられており、デモページ(シンプルすぎかも)もあるため、英語が苦手な人でも大丈夫だと思います。 下記に、チュートリアルをいくつかご紹介。 アニメーションでフェードイン・フェードアウト <textarea name="code" class="html" cols="60" rows="5"> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascr
Multi-line JavaScript これは必見!JavaScriptの文字列を複数行で定義する方法。 以下のようなコードは動くようで、うまく動きません。 <script type="text/javascript"> <!-- var a = '1 2 3'; alert(a); //--> </script> これを、行末に ¥ を入れます。 <script type="text/javascript"> <!-- var a = '1¥ 2¥ 3'; alert(a); //--> </script> すると、 と動くようです。 文字列の途中で改行したい場合に、一旦区切って 'aaa'+(改行)+'bbb' みたいにしなくてよくなります。 ということで、私も知らなかったのですが、知っておくとよいかもしれませんね。 firefox,ie,chromeで動作確認。 知ってた方はごめ
Indicator type : Background color : # Transparent background Foreground color : # Create easily your own ajax loader icon : Select the type of indicator you want Enter the background code color you want (tick "Transparent background" if you don't want one Enter the foreground code color you want Press "Generate it"
次はJSON形式のファイルを用意し、ダウンロードして利用してみます。次のようなJSON形式のファイルを用意しました。 { "marker":[ {"lat":41.772596,"lng":140.725261,"name":"函館朝市"}, {"lat":41.796864,"lng":140.756965,"name":"五稜郭"}, {"lat":41.772912,"lng":140.816231,"name":"函館空港"} ] } まずは読み込んだデータをeval関数を使ってオブジェクトに変換します。 function createMap(jsondata, statusCode){ var obj = eval("(" + jsondata + ")"); } 各プロパティに対する値を取り出します。これを含まれているデータの数だけ繰り返します。 function create
jQueryとCakePHPの異種格闘技戦。jQueryが勝っとる。これからはjQueryか。prototypeはそれ自体が汎用的な単語のため、フェアな勝負にならない。 そういうわけでjQueryのajaxを使ってみて(とりあえず挫折)したのでメモ。(いや、ajaxを使うというだけなら簡単。使い方が悪いだけ。) $.ajax()を使えばいい。 $.ajax({ url: 'hogehoge.htm', type: 'POST', dataType: 'json', // xml、 html、script、json data: params, timeout: 1000, error: function(){ // エラー時 alert('Error'); }, success: function(htm){ // コールバック } }); 上記コードで’hogehoge.htm’にpost
これまで、 HTML 文書から直接 CGI を呼び出すことで、掲示板みたいなものを実現してきました。 今回は、 JavaScript ファイルを追加して、いわゆる "Ajax" に挑戦してみます。 HTML : visitor_world6.html 今回のメッセージ送信画面は、今までとちょっと違います。 メッセージを記入する "TextBox" と "Submit" "Clear" ボタンが並んでいる所までは同じなのですが、今回は、その下にメッセージのリストが表示されています。 "TextBox" にメッセージを記入して、 "Submit" ボタンが押したら、今までは CGI を直接呼び出していました。 今回は、一旦 "JavaScript" が "Submit" ボタンのクリックを受けとめて、そこから改めて CGI を呼び出して、メッセージの追加とメッセージ一覧の取り寄せを行います。
このデータを読み込み利用するにはdata = eval("("+データ+")")とすると変数dataにJSONで定義されたプロパティの値が入ります。例えば以下のようなJSONファイルがあるとします。 このデータを変数dataに読み込んだとします。userIDプロパティの値を読み出すにはdata.userIDと記述します。するとajaxの文字が返されます。同様にdata.userPWとするとxanaduの文字が返されます。単純にオブジェクト名.プロパティ名の記述で済みます。プロパティの値には関数なども定義することができます。これによりオブジェクト名.プロパティ名()として末尾にカッコを付加した場合にプロパティの内容=関数が実行されます。つまりメソッドを定義したのと同じことになります。 それでは実際のデータを読み込み表示してみます。以下の商品名とそれに関するデータが記述されたJSONデータを読
jQuery Droppablesでドロップ処理も超簡単ドラッグした要素をドロップして、いろいろな処理を行えるようにする jQuery UI の Droppables を紹介します。複雑な判定などを必要とするドロップ処理もjQueryなら極めて簡単に使えます。 前回は Draggables でDOM要素をドラッグしました。 今回は、その、ドラッグした要素をドロップしていろいろな処理を行えるようにする jQuery UI 、 Droppablesを紹介します。 前回見たとおり、jQueryではドラッグ処理を簡単に実装できますが、複雑な判定などを伴うドロップ処理も とても簡単に利用することができます。 jQuery Download jquey.js(-min.js) UI/Droppables Droppables デモ ダウンロード jquery.ui-1.0.zip (101 KB Dr
コンテンツ PHP入門 jQuery入門 Flash Flash(ActionScript)でゲーム作成入門 Flash(ActionScript)で様々なゲームを作ろう Flash(ActionScript)とPHPの連携入門 PHP(旧コンテンツ) PHPでファイルの読み書き・掲示板 PHPで日付・時刻の計算 PHPでアクセスカウンタ&解析 PHPでGDを使ってみよう PHPとPostgreSQLの連携入門 Java (旧コンテンツ) Javaでシューティングゲームを作ろう Perl (旧コンテンツ) CGI(Perl)の基本と掲示板作成 C/C++ C/C++言語とDXライブラリでゲーム作成入門 (旧コンテンツ)C言語とelで様々なゲームを作ろう jQuery simple plugins ひとりごと、ふたりごと(ブログパーツ) オリジナルソフトウェア その他未分類なモノ iOSアプ
今回使用する「Dialog」「Draggables」「Droppables」「Sortables」に必要なファイルは以下の通りです。 themes/ jquery-1.2.3.min.js jquery.dimensions.js ui.mouse.js ui.resizable.js ui.dialog.js ui.draggable.js ui.draggable.ext.js ui.droppable.js ui.droppable.ext.js ui.sortable.ext.js ui.sortable.js jQuery UI 1.5bを使うために、今回は同梱されているjQuery 1.2.3を使うことにします。バージョンが上がりますが、これまでのサンプルの動作に影響はありません。 ライブラリの設定 ライブラリの各ファイルを、head要素の子要素に以下のように指定します(
今回のサンプルの基本的な情報 ここまででDraggables、Droppables、Selectablesの基本的な使い方が分かったと思いますので、いよいよここからは、応用編のサンプル解説をしていきます。もう一度サンプルを見てみましょう。 ■ サンプルの基本設計 このサンプルの基本設計は次のようになります。 ディレクトリが2つあり、それぞれを親要素とするファイルが3つずつぶら下がる ディレクトリをselectable()にする ファイルをdraggable()にする ただし、初期状態は'disable'にしておき、ファイルが選択されたときに'enable'にする ディレクトリをdroppable()にする ファイルがディレクトリにドロップされたら、そのファイルが、そのドロップされたディレクトリの子要素になるようにDOMの操作を行う ■ 複数要素のドラッグ ここで1つ難しいのは、複数ファイル
16 26 08 2007 Ajaxでどんな事が出来るのかを知るサンプル集26種類 jQuery interface編 jQuery, Samples, Ajax 海外のjQueryを使ったAjaxサンプル集に日本語の紹介文をつけた記事 Effects Ajaxエフェクト集 要素の出現・消滅など全62種類のAjaxエフェクトサンプル Test new animate function 要素のAjaxアニメーションジェネレーター Use new functions stop, stopAll and pause to clear queue and stop flickering Ajaxでディレイ(遅延)を設定できるツールチップを表示サンプル Draggables | Droppables Ajaxでドロップ&ドラッグ出来るサンプル10種類 Sortables list
はじめに JavaScriptと非同期XML通信を使用することで、Webブラウザ上でリッチなUIを実現することができる、Ajax(Asynchronous Javascript And Xml)が最近流行です。しかし、実際にリッチなUIを構築するためには、サーバサイドもさることながら、JavaScriptを使ったクライアントサイドの複雑なコーディングを行う必要があります。 今回ご紹介するAjaxTags・AjaxFacesは、Ajaxを使った高機能なUIコンポーネントです。どちらもクライアントサイドのJavaScriptコーディングを行うことなく、JSPタグを記述するだけで使用することができます。AjaxTagsはJavaServer Pages(以下、JSPと表記)上で、AjaxFacesはJavaServer Faces(以下、JSFと表記)上で動作します。 AjaxTagsの動作原理
最近,Webエンジニアのまわりで注目されている技術に「Ajax」(エイジャックス)があります。従来のWebアプリケーションはインタラクティブな処理の際,ユーザーにページのリロード作業を強いることが多く,決して操作性が良いとは言えませんでした。しかしAjaxを利用すると,サーバーと非同期な通信ができるので,ページをリロードすることなくコンテンツを更新できます。このためデスクトップ・アプリケーションと同様な操作性を持つWebアプリケーションを作成できます。本連載では,実際にAjaxアプリケーションを開発しながら,Ajaxアプリケーションの動作の仕組みや,既存のWebアプリケーションとの違い,実装上の注意点などについて紹介していきます。 目次 第1回 古くて新しいアーキテクチャ 第2回 インクリメンタル検索を実現(クライアント編) 第3回 インクリメンタル検索を実現(サーバー編) 第4回 予測・
最近,Webエンジニアのまわりで注目されている技術に「Ajax」(エイジャックス)があります。従来のWebアプリケーションはインタラクティブな処理の際,ユーザーにページのリロード作業を強いることが多く,決して操作性が良いとは言えませんでした。しかしAjaxを利用すると,サーバーと非同期な通信ができるので,ページをリロードすることなくコンテンツを更新できます。このためデスクトップ・アプリケーションと同様な操作性を持つWebアプリケーションを作成できます。本連載では,実際にAjaxアプリケーションを開発しながら,Ajaxアプリケーションの動作の仕組みや,既存のWebアプリケーションとの違い,実装上の注意点などについて紹介していきます。 「枯れた技術」を組み合わせる 筆者にとってAjaxの第一印象は強烈でした。「Google Map」のスムーズな地図操作,「Google Suggest」のリアル
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く