How to change or remove the Scroller background style?

How to change or remove the Scroller background style?

divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

We just started using the Scroller extension and would like to change the default background styling from diagonal alternate stripes to just plain white. I've been trying to change it through JQuery but with no luck. The default html and css looks like this:

<div class="dataTables_scrollBody" style="position: relative; overflow: auto; height: 300px; width: 100%;">

div.dts div.dataTables_scrollBody {
    background: repeating-linear-gradient(45deg, #edeeff, #edeeff 10px, #fff 10px, #fff 20px);

I've tried different variations of each of the following with no change in the results:

         $("div.dts div.dataTables_scrollBody").css("background","");
         $(".div.dts .div.dataTables_scrollBody").css("background","");  
         $(".div.dataTables_scrollBody").css("background","");  
         $("div.dataTables_scrollBody").css("background","");   

I think the first one should have worked but it didn't. The only time I get any type of result is if I try:

         $("div.dts div.dataTables_scrollBody").removeAttr('style');

but that just removes all of the style attributes from the div except for the width:100%. The css from the class definition remains the same.

What am I doing wrong?

Thanks.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Answer ✓

    This is the CSS which defined the background style.

    So you could add:

    div.dts div.dataTables_scrollBody {
      background: blue; /* or whatever */
    }
    

    to your CSS.

    Allan

  • divad.thgirbladivad.thgirbla Posts: 36Questions: 14Answers: 1

    THanks. You can close this ticket

This discussion has been closed.