tags:

views:

108

answers:

2

Hey everyone

I have a really weird error. When I use sIFR to replace a single h1 element, everything else on the page disappears. It's really odd. I don't get any javascript errors.

If I edit out the sIFR.activate function in he sifr-config, everything is displayed normally...

This is my code... HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml"&gt;

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>sIFR test</title>

<link rel="stylesheet" href="css/sifr.css" type="text/css">

<link rel="stylesheet" href="css/index.css" type="text/css">

<script src="js/sifr.js" type="text/javascript"></script>

<script src="js/sifr-config.js" type="text/javascript"></script>

</head>
<body>

<h1>Dette er en overskrift</h1>

<ul class="menu">
<li class="parent active"><a href="#"><span>Main Menu Item 1</span></a>
  <ul>
    <li><a href="#"><span>Sub Menu Item 1</span></a></li>
    <li><a href="#"><span>Sub Menu Item 2</span></a></li>
    <li><a href="#"><span>Sub Menu Item 3</span></a></li>
    <li><a href="#"><span>Sub Menu Item 4</span></a></li>
    <li><a href="#"><span>Sub Menu Item 5</span></a></li>
  </ul>
</li>
<li class="parent"><a href="#"><span>Main Menu Item 2</span></a>
  <ul>
    <li><a href="#"><span>Sub Menu Item 1</span></a></li>
    <li><a href="#"><span>Sub Menu Item 2</span></a></li>
    <li><a href="#"><span>Sub Menu Item 3</span></a></li>
    <li><a href="#"><span>Sub Menu Item 4</span></a></li>
    <li><a href="#"><span>Sub Menu Item 5</span></a></li>
  </ul>
</li>
<li><a href="#"><span>Main Menu Item 3</span></a></li>
<li class="parent"><a href="#"><span>Main Menu Item 4</span></a>
  <ul>
    <li><a href="#"><span>Sub Menu Item 1</span></a></li>
    <li><a href="#"><span>Sub Menu Item 2</span></a></li>
  </ul>
</li>
<li><a href="#"><span>Main Menu Item 5</span></a></li>
</ul>
<br class="clearfloat" />
</body>
</html>

sifr-config.js:

var helvetica57 = { src: 'sifr/helveticaNeue57Condensed.swf' };

var helvetica67 = { src: 'sifr/helveticaNeue67Medium.swf' };

sIFR.activate(helvetica57, helvetica67);

sIFR.replace(helvetica67, {

  selector: 'h1',
  css: '.sIFR-root {color: #000000; }'

});

You can see an example here: www.runemadsen.com/innovation/sifr

+1  A: 

You've added the following CSS:

.sIFR-active {
  font-family: Verdana;
  visibility: hidden;
}

This hides the entire <html> element.

Mark Wubben
A: 

I had the same issue, basically the problem was calling activate from within another function or event. Moved it out and no problem.

John_