[英]How to change background image every click in windows 8 javascript
我正在使用Windows 8 Metro应用程序。 在我的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>
我想替换href="surf.jpg"
参考。 我还有一个文件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 });
而且我还有一个吸气剂和吸气剂:
// Getters/setters for image
image: {
get: function () { return this._data.image; },
set: function (value) { this._data.image = value; }
}
我在尝试开发应用程序时发现有代码使用JavaScript编写Blog阅读器.....我正在共享链接,您可以检查它是否以任何方式对您有所帮助。
http://msdn.microsoft.com/zh-CN/library/windows/apps/hh974582.aspx
您还可以查看Codeproject中的简单文章。....这也可以帮助您http://www.codeproject.com/Articles/338916/Windows-8-JavaScript-Metro-Application-Getting-Sta
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.