quirkey / sammy

Sammy is a tiny javascript framework built on top of jQuery, It's RESTful Evented Javascript.
http://sammyjs.org
MIT License
2.99k stars 384 forks source link

How can exclude header and footer in some route? #257

Closed strongant closed 7 years ago

strongant commented 7 years ago

For example: My route is:

 this.get('#/comments/:id', function(context) {
            var _id = this.params['id'];
            if (!_id) { return this.notFound(); }
            this.item = { id: _id };
            //this.partial('templates/comments-upload.template');
            context.render('templates/comments-upload.template', {})
        });

But footer and header is although exists?How to remove them ?

strongant commented 7 years ago

I try through jQuery remove them:

$('#header').text('');
$('#footer').text('');
  <div id="header" class="header-container">
        <header class="wrapper clearfix">
            <h1 class="title">Single Page Apps with jQuery Routing</h1>
            <nav>
                <ul>
                    <li><a href="#/">Home</a></li>
                    <li><a href="#/about/">About</a></li>
                </ul>
            </nav>
        </header>
    </div>

    <div class="main-container">
        <div class="main wrapper clearfix">
            <div id="app">
            </div>
        </div>
    </div>
    <div id="footer" class="footer-container">
        <footer class="wrapper">
            <h3>Made with ♡ in India ©2016</h3>
        </footer>
    </div>