日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
控件(使用JavaScript的HTML)

將新功能添加到 Windows 應(yīng)用商店應(yīng)用,例如自定義命令和和增強(qiáng)導(dǎo)航支持,以及 Windows 8.1 Preview 中的全新 HTML 和 JavaScript 控件。 對(duì)現(xiàn)有控件的更新可使這些控件更易于使用和添加更多功能,如拖放操作支持。 這些新控件和控件更新讓創(chuàng)建功能齊全的應(yīng)用變得***的簡(jiǎn)單。

成都網(wǎng)絡(luò)公司-成都網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)建站10余年經(jīng)驗(yàn)成就非凡,專業(yè)從事成都做網(wǎng)站、成都網(wǎng)站建設(shè),成都網(wǎng)頁(yè)設(shè)計(jì),成都網(wǎng)頁(yè)制作,軟文發(fā)布平臺(tái),廣告投放平臺(tái)等。10余年來(lái)已成功提供全面的成都網(wǎng)站建設(shè)方案,打造行業(yè)特色的成都網(wǎng)站建設(shè)案例,建站熱線:18982081108,我們期待您的來(lái)電!

新控件和控件更新

Windows 8.1 Preview 和適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)中引入了以下新控件和功能:

  • AppBarCommand
  • BackButton
  • Hub(中心)
  • ItemContainer
  • NavBar
  • Repeater
  • WebView

Windows 8.1 Preview 和適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)中包括這些現(xiàn)有控件的更新:

  • 對(duì) ListView 的拖放操作支持
  • 對(duì) ListView 中的項(xiàng)目重新排序
  • 新 ListView 布局:CellSpanningLayout
  • 其他 ListView 更新
  • 其他 Windows JavaScript 庫(kù)更新

使用適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)

新的 Microsoft Visual Studio 2013 Preview 項(xiàng)目中會(huì)自動(dòng)包含適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)。若要在使用 Windows 8 創(chuàng)建的項(xiàng)目中使用適用于 JavaScript 2.0 Preview 的 Windows 庫(kù),請(qǐng)將你的現(xiàn)有適用于 JavaScript 1 的 Windows 庫(kù)引用替換為

 
 
 
 
  1.  
  2.      
  3.      
  4.  
  5.      
  6.      
  7.      

對(duì)適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)的引用。

 
 
 
 
  1.  
  2.      
  3.      
  4.  
  5.      
  6.      
  7.      

Visual Studio 2013 Preview 可以自動(dòng)為你升級(jí)項(xiàng)目,你也可以手動(dòng)完成以下更新:

  • 向項(xiàng)目中添加對(duì)適用于 JavaScript 的 Windows 8.1 庫(kù)的引用。
  • 在你的應(yīng)用清單中,將 OSMinVersionOSMaxVersionTested 值更新為 6.3.0:
 
 
 
 
  1.  
  2.     6.3.0 
  3.     6.3.0 
  4.    

AppBarCommand

在 Windows 8.1 Preview 中,你可以使用一種名為“內(nèi)容”的新型 AppBarCommand 在使用 JavaScript 的 Windows 應(yīng)用商店應(yīng)用中創(chuàng)建自定義應(yīng)用欄命令。

此功能通過(guò)允許你在 commands 布局中放置自定義內(nèi)容,從而簡(jiǎn)化了使用自定義內(nèi)容創(chuàng)建應(yīng)用欄的過(guò)程。你可以利用對(duì)使用自定義內(nèi)容的應(yīng)用欄命令的全面內(nèi)置支持,包括鍵盤操作、命令定位,以及用于動(dòng)態(tài)顯示和隱藏命令的動(dòng)畫。

放入到 commands 布局中后,內(nèi)容類型 AppBarCommand 支持很多與默認(rèn)應(yīng)用欄命令相同的功能。

  • 在默認(rèn)應(yīng)用欄命令和自定義 AppBarCommand 之間已啟用鍵盤操作(Tab 鍵、箭頭鍵、Home 鍵以及 End 鍵)。
  • 新的內(nèi)容類型 AppBarCommand 能夠正常使用應(yīng)用欄可伸縮性。應(yīng)用在被縮小之后會(huì)動(dòng)態(tài)放棄文本標(biāo)簽。

BackButton

Windows 8.1 Preview 和適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)會(huì)以應(yīng)用的控件形式向平臺(tái)中添加更多導(dǎo)航支持。這些控件之一就是 BackButton。

BackButton 為你提供一個(gè)向自己的應(yīng)用中添加向后導(dǎo)航功能的簡(jiǎn)單方法。創(chuàng)建一個(gè) BackButton 控件很簡(jiǎn)單。

 
 
 
 
  1.  

BackButton 會(huì)自動(dòng)檢查導(dǎo)航堆棧,以確定用戶是否可以向后導(dǎo)航。如果沒(méi)有可向后導(dǎo)航的內(nèi)容,此按鈕會(huì)自動(dòng)禁用。當(dāng)用戶單擊此按鈕或使用鍵盤快捷方式(如 Alt+ 向左鍵或 BrowserBack 鍵)時(shí),它會(huì)自動(dòng)調(diào)用 WinJS.Navigation.back 函數(shù)以向后導(dǎo)航。你無(wú)需編寫任何代碼。

Hub(中心)

為了幫助提供更一致的導(dǎo)航體驗(yàn),Windows 8.1 Preview 和適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)添加了 Hub 控件。

很多 Windows 應(yīng)用商店應(yīng)用都使用中心導(dǎo)航模式,即一種分層的導(dǎo)航系統(tǒng)。此模式最適合具有大量?jī)?nèi)容或許多不同部分內(nèi)容供用戶瀏覽的應(yīng)用。

中心設(shè)計(jì)的實(shí)質(zhì)是將內(nèi)容分為不同的部分和不同級(jí)別的詳細(xì)信息。 中心頁(yè)是用戶進(jìn)入應(yīng)用的入口點(diǎn)。此處的內(nèi)容顯示在一個(gè)水平平移或垂直平移的平移視圖中,這樣用戶一眼就能看見(jiàn)新增內(nèi)容和可用功能。 中心由不同類別的內(nèi)容構(gòu)成,每個(gè)類別映射到應(yīng)用的部分頁(yè)中。每個(gè)部分都應(yīng)該顯示內(nèi)容或功能。中心應(yīng)該提供許多可以看到的變化,吸引用戶,并將他們吸引到應(yīng)用的各個(gè)部分。

 

有了 Windows 8.1 Preview,Hub 控件可使創(chuàng)建中心頁(yè)更容易。若要開始快速創(chuàng)建帶有 Hub 頁(yè)的應(yīng)用,請(qǐng)使用 Visual Studio 2013 Preview 中的“中心應(yīng)用”模板。

創(chuàng)建中心

若要?jiǎng)?chuàng)建中心,你需要為中心包含的每個(gè)部分添加一個(gè) Hub 控件和一個(gè) HubSection 對(duì)象。每個(gè) HubSection 都可以包含任何類型的內(nèi)容,包括其他 Windows JavaScript 庫(kù)控件。你可以使用 header 屬性來(lái)指定節(jié)標(biāo)題。部分頭文件可為靜態(tài)或交互文件。交互式頭文件顯示可隱藏的 V 形圖標(biāo),并在用戶與它們交互時(shí)提升事件。

以下示例定義了一個(gè)包含三個(gè)部分的 Hub。

 
 
 
 
  1.  
  2.  
  3.  
  4.      
  5.     hubPage 
  6.  
  7.      
  8.      
  9.      
  10.      
  11.  
  12.      
  13.      
  14.      
  15.      
  16.  
  17.  
  18.      
  19.          
  20.              
  21.              
  22.                 Hub example 
  23.              
  24.          
  25.  
  26.          
  27.              
  28.  
  29.  
  30.              
  31.                  
  32.                 
 
  •                 
  •  
  •                  
  •                      
  •                      
  •                      
  •                 
  •  
  •             
  •  
  •  
  •             
  •                 data-win-options="{ onheaderinvoked: HubPage.section2HeaderNavigate }"> 
  •                  
  •                      
  •                      
  •                         
  •  
  •                         
  •  
  •                         
  •  
  •                     
  •  
  •                 
  •  
  •                 
  •                         layout: {type: WinJS.UI.ListLayout2}, 
  •                         selectionMode: 'none', 
  •                         itemTemplate: select('.section2 .itemTemplate'),   
  •                         itemDataSource: HubPage.section2DataSource, 
  •                         oniteminvoked: HubPage.section2ItemNavigate 
  •                     }"> 
  •                 
  •  
  •             
  •  
  •  
  •              
  •                  
  •                      
  •                 
  •  
  •                  
  •                      
  •                      
  •                      
  •                  
  •                  
  •                  
  •                      
  •                      
  •                  
  •              
  •  
  •  
  •          
  •      
  •  
  •  
  • 該代碼創(chuàng)建此頁(yè)面。

     

    單擊第二個(gè)標(biāo)題時(shí),應(yīng)用會(huì)轉(zhuǎn)到第二頁(yè)。

     

    以下代碼執(zhí)行導(dǎo)航。

     
     
     
     
    1. (function () { 
    2.     "use strict"; 
    3.  
    4.     var nav = WinJS.Navigation; 
    5.     var session = WinJS.Application.sessionState; 
    6.     var util = WinJS.Utilities; 
    7.  
    8.     // Get the groups used by the data-bound sections of the hub. 
    9.     var section2Group = Data.resolveGroupReference("group1"); 
    10.     var section5Group = Data.resolveGroupReference("group6"); 
    11.  
    12.     WinJS.UI.Pages.define("/pages/hub/hub.html", { 
    13.         // This function is called whenever a user navigates to this page. It 
    14.         // populates the page elements with the app's data. 
    15.         ready: function (element, options) { 
    16.             var hub = element.querySelector(".hub").winControl; 
    17.             hub.onloadingstatechanged = function (args) { 
    18.                 if (args.srcElement === hub.element && args.detail.loadingState === "complete") { 
    19.                     this._hubReady(hub); 
    20.                     hub.onloadingstatechanged = null; 
    21.                 } 
    22.             }.bind(this); 
    23.  
    24.             hub.onheaderinvoked = function (args) { 
    25.                 args.detail.section.onheaderinvoked(args); 
    26.             }; 
    27.  
    28.             // TODO: Initialize the page here. 
    29.         }, 
    30.  
    31.         unload: function () { 
    32.             // TODO: Respond to navigations away from this page. 
    33.             session.hubScroll = document.querySelector(".hub").winControl.scrollPosition; 
    34.         }, 
    35.  
    36.         updateLayout: function (element, viewState, lastViewState) { 
    37.             ///  
    38.  
    39.             // TODO: Respond to changes in viewState. 
    40.         }, 
    41.  
    42.         _hubReady: function (hub) { 
    43.             ///  
    44.  
    45.             WinJS.Resources.processAll(); 
    46.             if (typeof session.hubScroll === "number") { 
    47.                 hub.scrollPosition = session.hubScroll; 
    48.             } 
    49.  
    50.             // TODO: Initialize the hub sections here. 
    51.         }, 
    52.     }); 
    53.  
    54.     function createHeaderNavigator(group) { 
    55.         return util.markSupportedForProcessing(function (args) { 
    56.             nav.navigate("/pages/section/section.html", { title: this.header, groupKey: group.key }); 
    57.         }); 
    58.     } 
    59.  
    60.     function createItemNavigator(group) { 
    61.         var items = Data.getItemsFromGroup(group); 
    62.         return util.markSupportedForProcessing(function (args) { 
    63.             var item = Data.getItemReference(items.getAt(args.detail.itemIndex)); 
    64.             nav.navigate("/pages/item/item.html", { item: item }); 
    65.         }); 
    66.     } 
    67.  
    68.     function getItemsDataSourceFromGroup(group) { 
    69.         return Data.getItemsFromGroup(group).dataSource; 
    70.     } 
    71.  
    72.     WinJS.Namespace.define("HubPage", { 
    73.         section2DataSource: getItemsDataSourceFromGroup(section2Group), 
    74.         section2HeaderNavigate: createHeaderNavigator(section2Group), 
    75.         section2ItemNavigate: createItemNavigator(section2Group), 
    76.         section5DataSource: getItemsDataSourceFromGroup(section5Group), 
    77.         section5ItemNavigate: createItemNavigator(section5Group) 
    78.     }); 
    79. })(); 

    你甚至可使用 Hub 控件和 SemanticZoom 控件。有關(guān)此控制和更多的示例,請(qǐng)參閱 HTML 中心控件示例。

    ItemContainer

    新的 ItemContainer 控件可簡(jiǎn)化創(chuàng)建交互式元素的過(guò)程,這些元素提供了輕掃、拖放以及懸停功能。只需將你的內(nèi)容放到 ItemContainer 中即可。ItemContainer 可以包含標(biāo)準(zhǔn) HTML 元素,甚至其他 Windows JavaScript 庫(kù)控件。

    ItemContainer 很靈活,從而使其非常適合很多用途,如創(chuàng)建內(nèi)容豐富的復(fù)選框組、導(dǎo)航按鈕,以及購(gòu)物車表示。

    當(dāng)你希望顯示項(xiàng)目,但又不需要使用全部 ListView 功能時(shí),可以使用 ItemContainer 控件。

    使用 ItemContainer

    以下示例將創(chuàng)建兩個(gè) ItemContainer 對(duì)象,并將它們的 tapBehavior 屬性設(shè)置為 toggleSelect 以便可以被選擇。

     
     
     
     
    1.     data-win-control="WinJS.UI.ItemContainer" 
    2.     data-win-options="{tapBehavior: 'toggleSelect'}" 
    3.     style="width: 300px;"> 
    4.      
    5.         
    6.             style="margin-bottom: 5px;"> 
    7.             Banana 
    8.          
    9.          
    10.         
      Frozen yogurt
       
    11.      
    12.  
    13.     data-win-control="WinJS.UI.ItemContainer" 
    14.     data-win-options="{tapBehavior: 'toggleSelect'}" 
    15.     style="width: 300px;"> 
    16.      
    17.         
    18.             style="margin-bottom: 5px;"> 
    19.             Strawberry 
    20.          
    21.          
    22.         
      Ice cream
       
    23.      
    24.  

    你還可以將一個(gè) ItemContainer 與一個(gè) Repeater 控件一起使用以從 List 生成項(xiàng)目:只需將 ItemContainer 放入你的 Template 控件中即可。

     
     
     
     
    1.  
    2.     
    3.         data-win-control="WinJS.UI.ItemContainer"  
    4.         data-win-options="{tapBehavior: WinJS.UI.TapBehavior.toggleSelect}" 
    5.         style="width: 300px;"> 
    6.             
    7.                  style=" margin: 10px; padding: 10px; background-color: lightgray"> 
    8.                 
    9.                     style="margin-bottom: 5px;"  
    10.                     data-win-bind="textContent: title"> 
    11.                  
    12.                  
    13.              
    14.      
    15.  
    16.  
    17.     data-win-options="{data: ItemContainerExample.flavorList,  
    18.     template: select('#itemTemplate')}"> 
    19.  

    以下示例定義了數(shù)據(jù)源。

     
     
     
     
    1. (function () { 
    2.     "use strict"; 
    3.  
    4.     var basicList = new WinJS.Binding.List( 
    5.         [ 
    6.             { title: "Banana blast", desc: 'Frozen yogurt', image: '/images/60Banana.png'  }, 
    7.             { title: "Strawberry swirl", desc: 'Ice cream', image: '/images/60Strawberry.png' }, 
    8.             { title: "Magnificant mint", desc: 'Frozen yogurt', image: '/images/60Mint.png' }, 
    9.             { title: "Lemon lift", desc: 'Frozen yogurt', image: '/images/60Lemon.png' } 
    10.         ]); 
    11.  
    12.     WinJS.Namespace.define("ItemContainerExample", 
    13.         { 
    14.             flavorList: basicList 
    15.  
    16.         }); 
    17. })(); 

    默認(rèn)情況下可以選擇項(xiàng)目。若要禁用選擇,請(qǐng)將 ItemContainer 控件的 selectionDisabled 屬性設(shè)置為 true

    NavBar

    [立即獲取 HTML NavBar 控件示例。]

    Windows 8.1 Preview 和適用于 JavaScript 2.0 Preview 的 Windows 庫(kù)中引入了以下新控件,以幫助你提供一致且可預(yù)測(cè)的導(dǎo)航體驗(yàn):WinJS.UI.NavBar 控件。

    NavBar 類似于專用于導(dǎo)航命令的 AppBar。(實(shí)際上,NavBarAppBar 的子類。)它可以包含一系列簡(jiǎn)單的鏈接,也可以包含分類顯示的多個(gè)級(jí)別的鏈接。你可以使用以下方法填充 NavBar:硬編碼條目、以編程方式更新它,或者使用數(shù)據(jù)綁定。

    NavBar 會(huì)在用戶需要時(shí)顯示在應(yīng)用屏幕的頁(yè)首。用戶可以通過(guò)以下方式調(diào)用 NavBar:執(zhí)行邊緣輕掃、按 Windows 徽標(biāo)鍵 + Z,或者右鍵單擊。

    NavBar 還支持垂直布局和拆分的導(dǎo)航項(xiàng)(具有子導(dǎo)航選項(xiàng)的導(dǎo)航項(xiàng))。NavBar 是一個(gè)高度可自定義的對(duì)象:你可以使用級(jí)聯(lián)樣式表 (CSS) 設(shè)計(jì) NavBar 及其內(nèi)容的幾乎所有方面的樣式,還可以創(chuàng)建自定義導(dǎo)航項(xiàng)。

    創(chuàng)建 NavBar

    NavBar 包括三個(gè)組件:

    若要啟用導(dǎo)航,你可以設(shè)置 NavBarCommand 對(duì)象的 location 屬性。用戶單擊命令時(shí),WinJS.Navigation.navigated 事件啟動(dòng)。 使用此事件導(dǎo)航到指定的位置。

    也可以在 NavBar 上注冊(cè) oninvoked 事件,并使用你的事件處理程序執(zhí)行導(dǎo)航操作。

    以下示例顯示了一個(gè)包含兩個(gè)導(dǎo)航項(xiàng)的簡(jiǎn)單 NavBar。

     
     
     
     
    1.  
    2.      
    3.             
    4.                 label: 'Home', 
    5.                 icon: WinJS.UI.AppBarIcon.home, 
    6.                 location: '/html/home.html', 
    7.                 splitButton: false 
    8.                 }"> 
    9.              
    10.             
    11.                 label: 'Your apps', 
    12.                 icon: WinJS.UI.AppBarIcon.favorite, 
    13.                 location: '/html/yourapps.html', 
    14.                 splitButton: false 
    15.                 }"> 
    16.              
    17.      
    18.  

    NavBar 如下所示。

    可創(chuàng)建包含子 NavBarCommand 對(duì)象的 NavBarCommand。要這樣做,請(qǐng)將父 NavBarCommand 對(duì)象的 splitButton 屬性設(shè)置為 true,然后使用 splittoggle 事件顯示一個(gè)包含子 NavBarCommand 對(duì)象的 Flyout。此處是其***個(gè)部分的示例代碼。

     
     
     
     
    1.  
    2.      
    3.         
    4.             data-win-options="{ label: 'Home', icon: 'url(../images/homeIcon.png)' }"> 
    5.          
    6.         
    7.             data-win-options="{ label: 'Favorite', icon: WinJS.UI.AppBarIcon.favorite, splitButton: 'true' }"> 
    8.          
    9.         
    10.             data-win-options="{ label: 'Your account', icon: WinJS.UI.AppBarIcon.people }"> 
    11.          
    12.      
    13.  
    14.     data-win-options="{ placement: 'bottom' }"> 
    15.      
    16.         
    17.             data-win-options="{ label: 'Family' }"> 
    18.          
    19.          <
      標(biāo)題名稱:控件(使用JavaScript的HTML)
      網(wǎng)頁(yè)地址:http://m.5511xx.com/article/codgogd.html