Difference between revisions of "Template:USTC-Software/js/addBackground"

Line 1: Line 1:
 
$(document).ready(function () {
 
$(document).ready(function () {
   $("#content").css("background", "url('https://static.igem.org/mediawiki/2019/0/06/T--USTC-Software--lhr.svg')");
+
   class Background{
  $("div.card").css("background", "rgba(255, 255, 255, .5)");
+
      constructor(){
 +
 
 +
      }
 +
      changeBackground(){
 +
        $("body").css("background", "url('https://static.igem.org/mediawiki/2019/0/06/T--USTC-Software--lhr.svg') 0% 0% no-repeat/ cover");
 +
      }
 +
      changePageCardOpacity(opacity=0.7){
 +
        $("div.card").css("background", "rgba(255, 255, 255, " + opacity + ")");
 +
      }
 +
  }
 +
 
 +
  let background = new Background();
 +
  background.changeBackground();
 +
  background.changePageCardOpacity(0.6);
 +
 
 
});
 
});

Revision as of 13:45, 9 October 2019

$(document).ready(function () {

  class Background{
     constructor(){
     }
     changeBackground(){
        $("body").css("background", "url('https://static.igem.org/mediawiki/2019/0/06/T--USTC-Software--lhr.svg') 0% 0% no-repeat/ cover");
     }
     changePageCardOpacity(opacity=0.7){
        $("div.card").css("background", "rgba(255, 255, 255, " + opacity + ")");
     }
  }
  let background = new Background();
  background.changeBackground();
  background.changePageCardOpacity(0.6);

});