Skip to Content
JQUERY UI使用者介面設計
book

JQUERY UI使用者介面設計

by Eric Sarrion
November 2012
Intermediate to advanced
248 pages
4h 31m
Chinese
GoTop Information, Inc.
Content preview from JQUERY UI使用者介面設計
對話盒
|
41
<script>
$("#dialog1, #dialog2").dialog();
</script>
4-2 同時顯示的對話盒
dialog()
方法會把 selector 選取的每個元素(在這個例子裡是兩個
<div>
元素)都轉成
對話盒顯示出來。它們一開始會堆疊在一起,使用者只要拖拉對話盒的標題列即可移動
位置。
設定內容格式
使用
dialog()
方法會大幅改變頁面內的 HTML 元素顯示效果。這個方法確實會掃描
HTML 並且為相關元素(這邊的對話盒)加上新的 CSS class,讓它們以適當的效果顯現。
舉例來說,以下是
dialog()
呼叫後的 HTML 碼(圖 4-3)。這段原始碼是以 Firefox
Firebug 附加元件看到的。
42
|
第四章
4-3 dialog() 方法產生的 HTML
這些 CSS class 可以用來調整元素的顯示效果。比如說,如果我們修改
<div>
元素擁
有的
ui-dialog-titlebar
CSS class,就會改變視窗標題的外觀。同樣地,如果我們修
<div>
元素擁有的
ui-dialog-content
CSS class,就會讓視窗內容以不同的效果顯示
出來。
加入
<style>
標籤,修改 HTML 裡面這些元素(粗體標示部份) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

jQuery Mobile建置與執行

jQuery Mobile建置與執行

Maximiliano Firtman
Pro JSF and HTML5: Building Rich Internet Components, Second Edition

Pro JSF and HTML5: Building Rich Internet Components, Second Edition

Hazem Saleh, Allan Lykke Christensen, Zubin Wadia

Publisher Resources

ISBN: 9789862766460