0

I am applying custom css to infrajistics webmonthcalendercontrol when I add custom day I apply css class which I define it on site.css, but when I include contextmenu.js file and some javascript function the css is not working,

.myUnavalable
{

    color:Green;
    background-color:Green;
    text-decoration:blink;
}

in contextmenu.js style for menu div is define.

    ContextMenuDiv.id = 'ContextMenu'; 
    ContextMenuDiv.style.position = 'absolute';
    ContextMenuDiv.style.backgroundColor = 'transparent';
    ContextMenuDiv.style.border = '2px outset transparent';
    ContextMenuDiv.style.verticalAlign = 'top';
    ContextMenuDiv.style.textAlign = 'left';
    ContextMenuDiv.style.visibility = 'hidden';
    ContextMenuDiv.style.width = (Width + 11) + 'px';

I want to change background color of the customdate. How to overcome this problem?

2
  • If you inspect the element in any kind of DOM Inspector (Firebug et. al.), do you see that the element in question has a. the class applied and b. its rules are not overwritten? Commented Mar 12, 2012 at 11:42
  • Use !important tag in your css files to make them over-ride all values set for style elements. Commented Mar 12, 2012 at 11:43

2 Answers 2

1

You've answered your own question. Look at the code you posted. Your class:

background-color:Green;

The javascript:

ContextMenuDiv.style.backgroundColor = 'transparent';

The javascript is overwriting your style. Either remove the background color from the JS file or change your class to be this:

background-color:Green !important;

And take out the "Blink"... that's the UI equivalent of smacking your page viewer in the face with a rotten fish.

Sign up to request clarification or add additional context in comments.

Comments

0

use firebug and check which styles your control is taking. probably your .js file have its own css which overwrite your custom css.

if so, try using !important in your css

eg.

.myUnavalable
{
    background-color:Green !important;
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.