문제

I am curious about how to put a default image to a GridLayout item by using the templates. Can anyone provide any suggestions?

Here is my template

<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>

도움이 되었습니까?

해결책

Just add a new 'loading' image in the slution and in the template just apply new style to the image and specify background image property

Example is shown below

  <img class="photoTemplateImage" src="#" alt="" data-win-bind="src: imageUrl WinJS.Binding.oneTime; alt: title"  style="background-image: url(loadingimage.gif)" />

You can add the background image property to the class.. So you can avoid using in line styles..

Change the url depend on where you storing the image

refer this post

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top