- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 12:19 PM
Hi Everyone,
I have a need to set my company's logo as a background on the form of a custom table. I'm not entirely sure where to begin with this one. I imagine doing something like this but not entirely sure where to put it? UI Script on the page? My attempts at that failed.
Any help would be greatly appreciated!
Thanks all!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 01:14 PM
Use this for background size
function onLoad() {
//Type appropriate comment here, and begin script below
document.body.style.backgroundImage = "url('10Things02a_v2.png')";
document.body.style.backgroundSize = 'cover';
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2017 01:25 PM
I just found that and it works super well. It just cut off the bottom part. I adjusted it just a little bit and this is my final script:
function onLoad() {
//Type appropriate comment here, and begin script below
document.body.style.backgroundImage = "url('staff_logo.jpg')";
document.body.style.backgroundRepeat = "no-repeat";
document.body.style.backgroundSize = "100% 100%";
}
Thanks you guys for helping!! And so quickly! I know I'll be using this a ton!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2020 01:14 AM
I am done with the same but not changed not back ground
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2023 05:24 AM
Hi
Please follow my article to set background of the form
Mark correct/helpful if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2023 08:14 AM
Hi,
yeah uhm...
I followed your little tutorial, frankly looks cool from what you showed, but for me the formatter just display the content of the UI Macro... You said to put the formatter on the page, but does it need to have a particular place for it?
I'm not sure what the content of the UI Macro does concretely. I inspected the element of the page to see what you were pointing at, '.scroll-touch' makes sense, but the rest doesn't for me. I will say though that I am doing this for a custom table, so maybe since the elements I have are different, the components are different from your UI Macro.
But, if that is the case, can you please explain to me why it was important to specify the rest of elements?
I'm trying to understand how to change it so that mine works on the custom table I have. But for this I need to understand yours.
Thanks,
Darius
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2023 10:53 PM
Hi Darius
Since SN introduced Next experience as well, so the UI macro has all the classes being used in the Native UI as well as the Next Exp. So if you are inspecting in one of the UI you may not see the other classes. Hope it makes sense!