Facebox jquery.mw

Simple jQuery Modal Window

~ ~
Hwalow sob, Saya datang lagi nih . Lama ga posting rasa nya, hilang semangat bloging,wah.... gawat . SEMANGAT ! hohohohoo . =D

Sekarang saya mau share cara buat modal window . Dulu waktu share tentang Dekstop Template jQuery ada modal window waktu di double klik icon dekstopnya .

Sekarang bakal share cara buat modal window yg lebih simple . Untuk Contohnya klik disini . Kalo dklik muncul window baru atau yg disebut modal window . Bisa di resize, minimaze dan juga di drag .

Langsung aja cara bro..

1. Seperti biasa karena plugin jQuery, masukan script ini,
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>


Nb: Kalo udah ada biarin aja yawh..

2.Masukan script ini dibawah script di atas,
<script src='http://h1.ripway.com/r3ndra/jquery.wm.js' type='text/javascript'/>


Nb: http://h1.ripway.com/r3ndra/jquery.wm.js di hostingkan sendiri, ke hostingan favorit sobat, karena bebehari yg lalu server ripway sempet down . Jadi pilih hostingan yg menurut sobat bagus dan terpercaya .

3. Masukan Css nya,
.window {
position: fixed;
border: 1px outset #036;
background-color: #DDE;
width: 600px;
height: 500px;
}

.window.maximized {
border-width: 0;
}

#resizerproxy,#moverproxy {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 999999999;
display: none;
}
#resizerproxy > div,#moverproxy > div {
position: absolute;
border: 2px solid #000;
}

.windowtitlebar {
position: absolute;
top: 1px;
left: 1px;
right: 1px;
height: 24px;
overflow: hidden;
background-color: #999;
cursor: default;
}

.window.focused .windowtitlebar {
background-color: #999;
}

.windowtitlebar > .horizbuts {
position: absolute;
top: 0;
width: 59px;
right: 0;
bottom: 0;
}

.horizbuts > * {
float: left;
width: 16px;
height: 16px;
border: 1px outset #000;
margin: 3px 1px 0 0;
background: #fff url(http://i33.tinypic.com/2pzi8ug.jpg) no-repeat scroll;
}

.horizbuts > .minimizebut {
background-position: -3px 0;
}
.horizbuts > .maximizebut {
background-position: -32px -1px;
}
.horizbuts > .closebut {
background-position: -47px -1px;
}
.horizbuts > .restorebut {
display: none;
background-position: -18px -1px;
}
.window.maximized .horizbuts > .maximizebut { display: none; }
.window.maximized .horizbuts > .restorebut { display: block; }
.window.minimized .horizbuts > .minimizebut { display: none; }
.window.minimized .horizbuts > .restorebut { display: block; }

.windowcontent {
border: 1px inset #999;
border-bottom: 0;
position: absolute;
top: 25px;
right: 1px;
left: 1px;
bottom: 2px;
overflow: auto;
background-color: white;
}
.windowcontent > iframe {
border: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 2;
}
.windowcontent > .iframecover {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 3;
}
.window.focused > .windowcontent > .iframecover {
z-index: 1;
}
.window.moving > .windowcontent > .iframecover {
z-index: 3 !important;
}
.resizer-tl { position: absolute; left: -2px; top: -2px; width: 6px; height: 6px; cursor: se-resize; }
.resizer-t { position: absolute; left: 6px; right: 6px; top: -2px; height: 6px; cursor: n-resize;}
.resizer-tr { position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; cursor: ne-resize;}
.resizer-r { position: absolute; top: 6px; bottom: 6px; right: -2px; width: 6px; cursor: e-resize; }
.resizer-br { position: absolute; right: -2px; bottom: -2px; width: 6px; height: 6px; cursor: se-resize;}
.resizer-b { position: absolute; left: 6px; right: 6px; bottom: -2px; height: 6px; cursor: s-resize; }
.resizer-bl { position: absolute; left: -2px; bottom: -2px; width: 6px; height: 6px; cursor: ne-resize;}
.resizer-l { position: absolute; top: 6px; bottom: 6px; left: -2px; width: 6px; cursor: w-resize;}

.titlebaricon {
position: absolute;
left: 4px;
top: 4px;
width: 16px;
height: 16px;
overflow: hidden;
}

.titlebartext {
position: absolute;
color: white;
font-weight: bold;
left: 24px;
top: 0;
right: 0;
bottom: 0;
overflow: hidden;
}

/* IE needs to think there is an image in some divs otherwise it optimizes them away */
.IE #resizerproxy,.IE #moverproxy,
.IE .resizer-tl, .IE .resizer-t, .IE .resizer-tr, .IE .resizer-r,
.IE .resizer-br, .IE .resizer-b, .IE .resizer-bl, .IE .resizer-l {
background: url('IEHACK');
}


Nb: http://i33.tinypic.com/2pzi8ug.jpg ini juga dihostingkan ndiri, tp klo mau pake . pake aja .

4. Terakhir Pemakaianya . Pemaikaianya Memakai target:_child Seperti ini,

<a href="link" target="_child">link</a>

untuk link bs menggunakan pemanggilan situs lain atau pemanggilan tag div .

nah gampang kan.. yup semoga bermanfaat sob .

8 komentar:

Posting Komentar