D$Web

Down with gravity!
2009 10 29 - background fail

I like sigils. They are pretty. So I spent the last hour playing with javascript to try and get a peek at the background image of the Errant Story site, most of which is hidden behind the actual content of the site. Pesky content.

Pasting the javascript into the address bar, I tried to hide the content. That didn't work for some reason, so I decided to just make it spit out the URLs of all the divs' background images. Here is the final-ish code I used (FireFox specific):

// remove comments and put all in the URL bar 
// as one line
javascript:
newbody="<:h1>Images</h1>"; 
for each(elem in document.getElementsByTagName('div')){ 
  var style= getComputedStyle(elem,''); 
  if (style){
    var bgi=style.getPropertyValue('background-image');
	if(bgi && bgi != "none"){
	  alert(bgi);
          //// what i wanted to do:
	  // newbody +="<img src='" + bgi + 
          //   "'/><br/>\n";
	}
  }
}
document.write(newbody);

Strangely, when I tried to append to the newbody variable, the script failed. I should probably install FireBug, but I didn't feel like it tonight. I ended up using alert() and copy/pasting each URL.

When I looked at the images at those URLs, the sigil was nowhere to be found. It's actually hidden in the transparent header.png, but only shows up in front of background.jpg. So I wrote an HTML page to show just those images (borrowing the stylesheet from the original). But when I did this, I discovered that the part of the sigil hidden behind the main div is actually... Not There. I bet those chinese characters actually say something about the cake being a lie.

blog comments powered by Disqus
To contact me, e-mail cathodion at gmail.com.