Javascript windows 8拆分应用程序自定义

Javascript windows 8拆分应用程序自定义,javascript,html,Javascript,Html,正如我们所知,windows 8拆分应用程序显示磁贴,所以我想在那里显示图像,每个磁贴上的每个图像都应该不同 下面是我在default.html页面上做的事情,其中标记是 <div class="item"> <img alt="some text" data-win-bind="source: imagePath"> <div class="item-overlay"> <h4 class="item-title" da

正如我们所知,windows 8拆分应用程序显示磁贴,所以我想在那里显示图像,每个磁贴上的每个图像都应该不同

下面是我在default.html页面上做的事情,其中标记是

<div class="item">
<img alt="some text" data-win-bind="source: imagePath">
<div class="item-overlay">
                <h4 class="item-title" data-win-bind="textContent: title"></h4>
                <h6 class="item-subtitle win-type-ellipsis" data-win-bind="textContent: subtitle"></h6>
            </div>
        </div>
    </div>
以下是解决方案(感谢Usman ur Rehman先生)

打开data.js并根据下面给出的代码更改代码

函数generateSampleData(){ var itemContent=“Curabitur类不合格品前庭不合格品……”


我没有关注Windows 8的实现细节,因此,如果这是一个愚蠢的问题,我只能道歉,但这是说:这些星号是出现在代码中,还是用来突出问题中的某些内容?还有,您卡在哪里了?您需要什么帮助?星号代表我的代码,我无法在默认页面上显示图像.此外,我也尝试过,但这对我也不起作用:(
var sampleGroups = [
            { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", **imagePath:"path of image file 1",** backgroundImage: darkGray, description: groupDescription },
            { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", **imagePath:"path of image file 2",** backgroundImage: lightGray, description: groupDescription },
            { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3",**imagePath:"path of image file 3",** backgroundImage: mediumGray, description: groupDescription },
            { key: "group4", title: "Group Title: 4", subtitle: "Group Subtitle: 4",imagePath:"path of image file 4", backgroundImage: lightGray, description: groupDescription },
            { key: "group5", title: "Group Title: 5", subtitle: "Group Subtitle: 5", imagePath:"path of image file 5", backgroundImage: mediumGray, description: groupDescription },
            { key: "group6", title: "Group Title: 6", subtitle: "Group Subtitle: 6", **imagePath:"path of image file 6",** backgroundImage: darkGray, description: groupDescription }
        ];
    // These three strings encode placeholder images. You will want to set the
    // backgroundImage property in your real data to be URLs to images.
    var darkGray =  "images/1.png";
    var lightGray = "images/1.png";
    var mediumGray = "images/1.png";

    // Each of these sample groups must have a unique key to be displayed
    // separately.
    var sampleGroups = [
        { key: "group1", title: "Group Title: 1", subtitle: "Group Subtitle: 1", backgroundImage: darkGray, description: groupDescription },
        { key: "group2", title: "Group Title: 2", subtitle: "Group Subtitle: 2", backgroundImage: lightGray, description: groupDescription },
        { key: "group3", title: "Group Title: 3", subtitle: "Group Subtitle: 3", backgroundImage: mediumGray, description: groupDescription }, .....