Javascript 如何在gridLayout项上放置默认图像?

Javascript 如何在gridLayout项上放置默认图像?,javascript,html,windows-8,windows-runtime,microsoft-metro,Javascript,Html,Windows 8,Windows Runtime,Microsoft Metro,我很好奇如何使用模板将默认图像放入GridLayout项。有人能提供一些建议吗 这是我的模板 <div class="gridLayoutItemTemplate" data-win-control="WinJS.Binding.Template" data-win- options="{tap: 'none'}"> <div class="photoTemplate"> <img class="photoTemplateImage" src

我很好奇如何使用模板将默认图像放入GridLayout项。有人能提供一些建议吗

这是我的模板

<div class="gridLayoutItemTemplate" data-win-control="WinJS.Binding.Template" data-win- options="{tap: 'none'}">
    <div class="photoTemplate">
        <img class="photoTemplateImage" src="#" alt="" data-win-bind="src: imageUrl WinJS.Binding.oneTime; alt: title" />
</div>

只需在图片和模板中添加一个新的“加载”图像 只需将新样式应用于图像并指定背景图像属性

示例如下所示

  <img class="photoTemplateImage" src="#" alt="" data-win-bind="src: imageUrl WinJS.Binding.oneTime; alt: title"  style="background-image: url(loadingimage.gif)" />
可以将“背景图像”属性添加到类中。。因此,可以避免使用内嵌样式

根据存储图像的位置更改url

提及