Jump to content

respond.js


ank
 Share

Recommended Posts

i am working on my first processwire project, and i love it.

but i can't get respond.js working (i use it for IE7 and 8).

It works fine on pure html pages, but when in convert the html to templates in processwire it seems not to work anymore.

Has someone experience with this ?

thanxs

ank

Link to comment
Share on other sites

this is exact the same code as in my html page before i made a template of it.

this is the complete header.inc

<!doctype html>
<html class="no-js" lang="nl">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title><?=$page->title?></title>
    <link href='http://fonts.googleapis.com/css?family=Ubuntu:300,500|Lusitana' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/css/main.css" />
    <link rel="stylesheet" type="text/css" href="/assets/css/jquery.fancybox.css?v=2.1.5" media="screen" />
    <link rel="stylesheet" type="text/css" href="/assets/css/jquery.fancybox-thumbs.css?v=1.0.7" />

    <!--[if lte IE 8]>
      <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/css/ie8-and-down.css" />
      <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
      <script type="text/javascript" src="/assets/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body>

  <div class="page-wrap">
      <header>  
          <div class="logodiv">
              <a href="/">
              </a>    
          </div> 
          <div id="topnavbar"></div>
          <nav class="animenu"> 
            <button class="animenu__toggle">
              <span class="animenu__toggle__bar"></span>
              <span class="animenu__toggle__bar"></span>
              <span class="animenu__toggle__bar"></span>
            </button>
            <ul class="animenu__nav">
                <?php
                $homepage = $pages->get("/");
                $children = $homepage->children;
                $children->prepend($homepage); 

                foreach($children as $child) {
                $class = $child === $page->rootParent ? " class='active'" : '';
                echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>";
                }
                ?>               
            </ul>
          </nav>
      </header>
Link to comment
Share on other sites

The problem are the relative paths.

<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>assets/css/main.css" />

You should do what you did here to all the paths, including respond.js:

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...