|
@@ -1,3 +1,17 @@
|
|
|
+function show1() {
|
|
|
+ var aTrue = document.getElementsByClassName(true);
|
|
|
+ var aFalse = document.getElementsByClassName(false);
|
|
|
+ var x = 1;
|
|
|
+ if (aTrue[0].style.display != "none") {
|
|
|
+ aTrue[0].style.display = "none";
|
|
|
+ aFalse[0].style.display = "inline";
|
|
|
+ } else {
|
|
|
+ aTrue[0].style.display = "inline";
|
|
|
+ aFalse[0].style.display = "none";
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
window.addEventListener('load', function() {
|
|
|
var preview_img = document.querySelector('.preview_img');
|
|
|
var mask = document.querySelector('.mask');
|
|
@@ -47,6 +61,41 @@ window.addEventListener('load', function() {
|
|
|
bigIMg.style.left = -bigX + 'px';
|
|
|
bigIMg.style.top = -bigY + 'px';
|
|
|
|
|
|
+
|
|
|
+ window.onload = function() {
|
|
|
+ var oSc = document.getElementById('shoucang');
|
|
|
+ var onOff = true;
|
|
|
+
|
|
|
+ oSc.onclick = function() {
|
|
|
+ if (onOff) {
|
|
|
+ oSc.innerHTML = '<i class="yishoucang"></i>' + '已收藏';
|
|
|
+ oSc.style.backgroundColor = '#87aab5';
|
|
|
+ onOff = false;
|
|
|
+ } else {
|
|
|
+ oSc.innerHTML = '收藏文章';
|
|
|
+ oSc.style.backgroundColor = '#87aab5';
|
|
|
+ onOff = true;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ oSc.onmouseover = function() {
|
|
|
+ if (onOff) {
|
|
|
+ oSc.style.backgroundColor = '#03a6d7';
|
|
|
+ } else {
|
|
|
+ oSc.innerHTML = '取消收藏';
|
|
|
+ oSc.style.backgroundColor = '#527884';
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ oSc.onmouseout = function() {
|
|
|
+ if (onOff) {
|
|
|
+ oSc.style.backgroundColor = '#00b7ee';
|
|
|
+ } else {
|
|
|
+ oSc.innerHTML = '<i class="yishoucang"></i>' + '已收藏';
|
|
|
+ oSc.style.backgroundColor = '#87aab5';
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
})
|