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.

1  
static JS js_fixedBackgroundImage(S imgURL) {
2  
  if (empty(imgURL)) null;
3  
  ret JS([[
4  
    var target = document.querySelector("body");
5  
    target.style.cssText = $style;
6  
  ]], style := nlToSpace(replaceDollarVars([[
7  
    background-image: url($imgURL);
8  
    background-attachment: fixed;
9  
    background-position: center;
10  
    background-repeat: no-repeat;
11  
    background-size: cover;
12  
  ]], +imgURL)));
13  
}

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: 143 / 213
Version history: 4 change(s)
Referenced in: [show references]