简体   繁体   English

Drupal和ParallaxJS(滑动页面)

[英]Drupal and ParallaxJS (sliding pages)

I am trying to use ParallaxJS to achieve a similar effect to the ParallaxJS Demo , although I am using Drupal 7 and wondering how this effects it. 我正在尝试使用ParallaxJS来实现与ParallaxJS Demo相似的效果,尽管我正在使用Drupal 7并想知道这会如何影响它。

In general these kind of designs have hardcoded containers for each page, whereas Drupal obviously creates them as separate pages. 通常,这类设计在每个页面上都有硬编码的容器,而Drupal显然将它们创建为单独的页面。 What would be the best way to create this effect on a Drupal site? 在Drupal网站上创建此效果的最佳方法是什么?

The approach I would use is to start with Views (http://drupal.org/project/views). 我将使用的方法是从Views(http://drupal.org/project/views)开始。

If you want a page with blocks displaying different node types or entity types you can easily do this in Views. 如果您希望页面中的块显示不同的节点类型或实体类型,则可以在“视图”中轻松完成此操作。 Explaining how Views works is a bit much typing but using it is a real advantage to working with Drupal. 解释Views的工作方式有点麻烦,但使用它是与Drupal一起使用的真正优势。

From the docs it seems ParallaxJS allows you to work with basically any elements so you should have get enough markup to make it work from Drupal. 从文档看来,ParallaxJS允许您基本上使用任何元素,因此您应该获得足够的标记以使其在Drupal中起作用。

Views can give you a page with the content you want. 视图可以为您提供所需内容的页面。 Making sure the ParallaxJS triggers on it is up to your JS code or your implementation of Drupal hooks. 确保ParallaxJS触发器取决于您的JS代码或Drupal挂钩的实现。 Off the top of my head you could use drupal_add_js in hook_init (arg-function or other methods can be used to check the path) to implement it in a custom module. 在我头顶上,您可以在hook_init中使用drupal_add_js(可以使用arg函数或其他方法来检查路径)在自定义模块中实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM