Polymer single page application with lightbox

时间:2015-04-29 00:24:20

标签: polymer lightbox single-page-application

regarding to this question i have changed my polymer spa a little to load content dynamically.
next thing is to add a lightbox gallery.
i have found a very lightweigt version here
as standalone it works very good but in my dynamic content page i am not able to get this work.
i created a git repo here

Thanks a lot.
Viktoria

ps: next things are a contact form some nice effect like wow.js, language selector and icon fonts

1 个答案:

答案 0 :(得分:0)

如果你只是想在页面上放置像自定义元素这样的静态内容,那么我认为不需要使用内容数组。所以我会改变你的final.html

     <div layout horizontal center-center fit>
      <core-animated-pages id="pages" selected="{{route}}" valueattr="hash"
                           transitions="slide-from-right">
          <section hash="about" layout vertical center-center>
            <about-us></about-us>
          </section>
      </core-animated-pages>
    </div>

然后您有1页可以使用http://address.com/#about

访问

要添加另一个页面,您需要做的就是添加另一个<section>,其中包含您希望路由的哈希属性。

我将假设您正在使用的教程使用自动绑定模板,并且在javascript中等待绑定该模板。或者您正在自定义元素中工作。

设置默认路由,将javascript中的路由行更改为

this.route = this.route || 'Single';

'Single'更改为您想要的默认页面。

希望有所帮助。

注意我也删除了点击功能,因为我只看到对该演示有用。