Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Different HTML background colours for different slides

Explorer ,
May 04, 2016 May 04, 2016

Captivate 9

Using the Skin Editor I can change the HTML background colour for the WHOLE project.

However, how can I change the HTML background colour WITHIN the project?

Example: I like to have a red HTML background for the first slide and a blue one for the second slide.

Is there any trick to get there?

(I`m not talking about the background on each slide, I really want to change the HTML backgrounds outside the slides, but dependent on the slide which is currently shown on the screen.)

Thanks in advance!

291
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , May 06, 2016 May 06, 2016

You can change it like this. You can execute this on slide enter. Just make an index for each color. You can put hex codes in also.

var myColors = [];

myColors[ 0 ] = '#FFCC00';  
myColors[ 1 ] = 'Blue';

myColors[ 2 ] = 'Green';
myColors[ 3 ] = 'Yellow';
document.getElementById('cpDocument').style.backgroundColor = myColors[ window.cpInfoCurrentSlide - 1 ];

Translate
People's Champ ,
May 04, 2016 May 04, 2016

We went through this recently and there is some kind of cover in CP that is blocking the background. Haven't really investigated it much.

In IE, if you change the background color with the developer tools open and expand the height of the tools area, you can see the background get exposed.

On enter of any slide execute this JS:

document.body.style.backgroundColor = "red";

you can use hex values or words for basic colors.

Not sure if you can find what ever is covering the background and hide it though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
May 06, 2016 May 06, 2016

You can change it like this. You can execute this on slide enter. Just make an index for each color. You can put hex codes in also.

var myColors = [];

myColors[ 0 ] = '#FFCC00';  
myColors[ 1 ] = 'Blue';

myColors[ 2 ] = 'Green';
myColors[ 3 ] = 'Yellow';
document.getElementById('cpDocument').style.backgroundColor = myColors[ window.cpInfoCurrentSlide - 1 ];

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 06, 2016 May 06, 2016
LATEST

Fantastic! This solves the problem! Thank you very much for your help!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources