GANCHIKU.com

Prototype Window Classをもう少し使ってみるテスト

Services_YouTubeのサンプルを作る際に使用したPrototype Window Classをもう少し使ってみた。以前、こういうの作りたかったんだよなーなんてのが結構簡単にできそう。アラートなんかも結構快適かも。

Prototype Window Class

ただやっぱりWindowの中にYouTubeのswfファイルを使用させるのはかなり重くなりそう。

で、こんな感じか。

Open Window

  • default
  • mac_os_x
  • spread
  • nuncio
  • darkX
  • alphacube
  • theme1
var win; var id = 0;
function openWindow(className) {
win = new Window('window_id' + id, {
className: className,
title: "Sample",
width:200, height:150}
);
win.getContent().innerHTML = "<h1>Hello World!</h1>";
win.setDestroyOnClose();
win.showCenter();
id++;
}

Open Alert

  • sample
function openAlert() {
Dialog.alert("Hello World!", {
windowParameters: {width:300, height:100},
okLabel: "close",
ok:function(win) {debug("validate alert panel"); return true;} });
}

Services_YouTube

var win;
function openVideo(video_id) {
if (win == undefined) {
win = new Window('window_id', {
className: "dialog", width:445, height:370, zIndex: 100, resizable: true, title: "Sample window", showEffect:Effect.BlindDown, hideEffect: Effect.SwitchOff, draggable:true });
}
win.getContent().innerHTML= '<div style="padding:10px"><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' + video_id + '"></param><embed xsrc="http://www.youtube.com/v/' + video_id + '" type="application/x-shockwave-flash" width="425" height="350"></embed></object></div>';
win.showCenter();
}

つか、ちゃんと動くかな。 やっぱり、UIがカコイイといいねー。

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Shin Ohno 2003-2012