📄 javascript1.js
字号:
function ImageChanger(imageId, parentId)
{
var thisObject = this;
this.Image = document.getElementById(imageId);
this.Parent = document.getElementById(parentId);
var Button1 = document.createElement("input");
Button1.type = "button";
Button1["class"] = "button";
Button1.style.width = "150px";
Button1.value = "Change to grayscale";
Button1.onclick = function(){thisObject.Change("Img/img_" + (window.currentIndex + 1) + "_bw.jpg")};
var Button2 = document.createElement("input");
Button2.type = "button";
Button2["class"] = "button";
Button2.style.width = "150px";
Button2.value = "Change to sepia";
Button2.onclick = function(){thisObject.Change("Img/img_" + (window.currentIndex + 1) + "_sepia.jpg")};
this.Parent.appendChild(Button1);
this.Parent.appendChild(Button2);
}
ImageChanger.prototype.Change = function(src)
{
this.Image.src = src;
};
var ImageChanger1 = new ImageChanger('myImg', 'ImageChangerContainer');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -