[英]How to change background image every click in windows 8 javascript
I am working on a Windows 8 metro application. 我正在使用Windows 8 Metro应用程序。 In my default.html file I have a background image:
在我的default.html文件中,有一个背景图片:
<div id="backgroundImage" >
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="myGaussianBlur" x="0" y="0">
<feGaussianBlur in="SourceGraphic" stdDeviation="2"></feGaussianBlur>
</filter>
</defs>
<image xlink:href="**surf.jpg**" width="100%" height="100%" preserveAspectRatio="none" filter="url(#myGaussianBlur)" />
</svg>
</div>
I would like to replace the href="surf.jpg"
reference. 我想替换
href="surf.jpg"
参考。 I have one more file, Creator.js
, that holds the current image: 我还有一个文件
Creator.js
,其中包含当前图像:
var ControlConstructor = WinJS.UI.Pages.define("Creator.html", {
// This function is called whenever a user navigates to this page. It
// populates the page elements with the app's data.
ready: function (element, options) {
// TODO: Initialize the page here.
// the options of the Creator are: image.
// image is the path to the boleh creator's background image.
options = options || {};
this._data = WinJS.Binding.as({ image: options.image });
and I have also a getter and a setter: 而且我还有一个吸气剂和吸气剂:
// Getters/setters for image
image: {
get: function () { return this._data.image; },
set: function (value) { this._data.image = value; }
}
i found out while i was trying to develop an app there was code write Blog reader using JavaScript.....I am sharing the link you can check if it helps you in any way. 我在尝试开发应用程序时发现有代码使用JavaScript编写Blog阅读器.....我正在共享链接,您可以检查它是否以任何方式对您有所帮助。
http://msdn.microsoft.com/en-us/library/windows/apps/hh974582.aspx http://msdn.microsoft.com/zh-CN/library/windows/apps/hh974582.aspx
You can also check a simple article that is there in Codeproject.....This can also help you http://www.codeproject.com/Articles/338916/Windows-8-JavaScript-Metro-Application-Getting-Sta 您还可以查看Codeproject中的简单文章。....这也可以帮助您http://www.codeproject.com/Articles/338916/Windows-8-JavaScript-Metro-Application-Getting-Sta
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.