Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1032828 // js_fixedBackgroundImage

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (4377L) is out of date.

static JS js_fixedBackgroundImage(S imgURL) {
  if (empty(imgURL)) null;
  ret JS([[
    var target = document.querySelector("body");
    target.style.cssText = $style;
  ]], style := nlToSpace(replaceDollarVars([[
    background-image: url($imgURL);
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  ]], +imgURL)));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032828
Snippet name: js_fixedBackgroundImage
Eternal ID of this version: #1032828/5
Text MD5: f69790c64bc6df5c510307961a4985cc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-06 14:59:32
Source code size: 413 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 73 / 116
Version history: 4 change(s)
Referenced in: [show references]