user883807
user883807

Reputation:

Foundation 5 Interchange html partial path

I'm trying to get Foundation 5's Interchange (with HTML partials) working but the partials are not loading in. Foundation5, jQuery and Interchange are located in

/bower_components/

index.html is located in

/src/

the small.html, medium.html and large.html partials are located in

/src/app/nav/


Here are the relevant files:

index.html included javascripts at bottom before </body>*

<!-- build:js(.) scripts/vendor.js -->
<!-- bower:js -->
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/jquery.cookie/jquery.cookie.js"></script>
<script src="bower_components/jquery-placeholder/jquery.placeholder.js"></script>
<script src="bower_components/foundation/js/foundation.js"></script>
<script src="bower_components/foundation/js/foundation/foundation.interchange.js"></script>
<!-- endbower -->
<!-- endbuild -->

interchange-test.html

<div data-interchange="[small.html, (small)], [medium.html, (medium)], [../large.html, (large)]">
    <div data-alert class="alert-box secondary radius">
        This is the default content.
    </div>
</div>

app.scss

/* Define mobile styles */
@media only screen { 
    body {
        background: red;
    }
}

/* min-width 641px, medium screens */
@media only screen and (min-width: 40.063em) { 
    body {
        background: orange;
    }
}

/* min-width 1025px, large screens */
@media only screen and (min-width: 64.063em) { 
    body {
        background: yellow;
    }
}

Any ideas on what is wrong here? Thanks in advance.

Upvotes: 1

Views: 403

Answers (1)

user883807
user883807

Reputation:

I solved this by adding $(document).foundation('interchange', 'reflow'); to my index.html and also I changed the partial paths by adding ../app/nav/ before the file name like so

<div data-interchange="[../app/nav/small.html, (small)], [../app/nav/medium.html, (medium)], [../app/nav/large.html, (large)]">
<div data-alert class="alert-box secondary radius">
    This is the default content.
</div>

Here is a discussion on Foundation's reflow http://foundation.zurb.com/forum/posts/1712-bind-foundation-5-clearing-to-dynamically-loaded-images

Upvotes: 1

Related Questions