简体   繁体   English

当它仍然是单个滑块时,该画廊如何更改URL,并且似乎每次都重新加载?

[英]How does this gallery change the URL, and seem to reload every time, when it is still a single slider?

I'm working with a client who is looking to create a gallery like this one used by Dazed and Confused magazine - http://www.dazeddigital.com/fashion/gallery/23093/8/the-dazed-alternative-gift-guide -我有一个客户,谁是希望创建这样一个由年少轻狂杂志使用的画廊工作http://www.dazeddigital.com/fashion/gallery/23093/8/the-dazed-alternative-gift-指南

What I'm confused by is that you can see that the number in the URL changes in line with the number of the slide (and changes to /related/ at the end) - how is this done? 我感到困惑的是,您可以看到URL中的数字与幻灯片的数字一致(并在末尾更改为/ related /)-如何完成? I'm aware of adding "#1, #2, etc" at the end of the URL but this seems different - as if each slide has a unique URL that can be easily accessed. 我知道在URL末尾添加“#1,#2等”,但这似乎有所不同-好像每个幻灯片都有一个可以轻松访问的唯一URL。

I'm trying to see if it is possible in WordPress but I'm keen to try and understand how it works already "in the wild." 我正在尝试查看WordPress中是否有可能,但我很想尝试了解它在“野外”的工作原理。

That's a very typical jQuery slider. 那是一个非常典型的jQuery滑块。 The best thing to learn how it works is to view the page source and use the developer tools in Firefox (or Firebug ) or Chrome or Safari or IE to see how the Javascript works. 要了解其工作原理,最好的方法是查看页面源并使用Firefox (或Firebug ), ChromeSafariIE中的开发人员工具查看Javascript的工作方式。

Dump the page source into an .html file on your desktop and play around with the code. 将页面源代码转储到桌面上的.html文件中,然后使用代码。

There's maybe a hundred slider plugins for WordPress: https://www.google.com/search?q=wordpress+slider+plugin WordPress可能有一百个滑块插件: https : //www.google.com/search? q = wordpress+slider+plugin

Not 100% sure this is what is happening but I would think so, all of those different urls redirect to the same page. 并非100%肯定这是正在发生的事情,但我会这样认为,所有这些不同的url都重定向到同一页面。 And that page is checking on load the url and if it matches any of the data attributes on the gallery it displays the gallery starting on that slide. 该页面正在检查加载的url,如果它与图库中的任何数据属性匹配,它就会从该幻灯片开始显示图库。 It is also using more data attributes to change the contents of the aside 它还使用更多的数据属性来更改内容的内容

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

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