简体   繁体   English

单击缩略图而不加载ajax即可加载文章

[英]Article gets loaded upon clicking on thumbnail without ajax

As shown in the demo(link below), when an article thumbnail was clicked, the full article appeared and the page did not refresh nor ajax was used. 如演示中所示(单击下面的链接),单击文章缩略图时,将显示完整的文章,并且页面没有刷新,也没有使用ajax。

Demo link: 演示链接:
http://tympanus.net/Development/AnimatedGridLayout/ http://tympanus.net/Development/AnimatedGridLayout/

Questions: 问题:

  1. By looking at the source code, the full article was actually loaded but hidden and was shown after I clicked on the thumbnail. 通过查看源代码,完整的文章实际上已被加载但被隐藏,并在单击缩略图后显示。 How did she manage to assign this X thumbnail to X article? 她如何设法将此X缩略图分配给X文章? I couldn't find any references that link them up. 我找不到将它们链接起来的任何引用。
  2. I want to achieve such effect too, is there any easier way to do it? 我也想达到这样的效果,有没有更简单的方法呢?

Download source code link: 下载源代码链接:
http://tympanus.net/codrops/2015/04/15/grid-item-animation-layout/ http://tympanus.net/codrops/2015/04/15/grid-item-animation-layout/

If i undesrtand correctly, for assigning X thumbnail to X article uses the position of the item in the array. 如果我正确取消描述,则将X缩略图分配给X文章将使用该项在数组中的位置。

Easier would be using id for each thumbnail and directly reference the article. 比较容易的是为每个缩略图使用ID并直接引用该文章。

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

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