1

I'm getting nowhere with this. I have an element, which is using a :before pseudo selector.

CSS is like this:

 .initHandler:before { 
      width: 100%; 
      position: absolute; 
      top: 0; 
      bottom: 0; 
      left: 0; 
      right: 0; 
      display: block; 
      height: 110%; 
      z-index: 999999;  
      background-color: white; /*background:white  url(../images/ajax-loader.gif) no-repeat center center;*/    
      content: "initializing..."; 
      text-align: center; 
      font-color: #ccc; 
      line-height: 150px; 
      vertical-align: bottom; 
      }

This gives me a white background for my app, which is loading "behind the curtain". On iOS I'm using a startup image, which I'm setting in the page head before jquery and jquerymobile are loaded.

I now want to change the background of my initHaendler:before element to the determined iOS splashscreen.

However I need to this in pure javascript and I have no idea how to select a class/pseudoelement to set a css value.

Can someone help out?

Thanks!

frequent
  • 26,445
  • 56
  • 171
  • 325

1 Answers1

2

Setting CSS pseudo-class rules from JavaScript seems to suggest that you can't and offers a workaround by appending a stylesheet to the document. I'm unsure if it'd work on iOS but it's worth a shot

Community
  • 1
  • 1
Adam Baxter
  • 1,677
  • 20
  • 39