将数字值更改为文本值? jQuery 画廊
I really like this jQuery Gallery
However, instead of numbers for navigation, I'd like to use words (e.g. Football / Rugby / Athletics).
How do I achieve this?
Many thanks for any pointers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在加载图库后覆盖它们:
编辑:
感谢您的小提琴:似乎有效:))) http://jsfiddle.net/mHsuU/2/
you could just overwrite them after the gallery is loaded:
edit:
thanks for the fiddle: seems to work :))) http://jsfiddle.net/mHsuU/2/
你必须修改源。从好的方面来说,修改源代码看起来非常简单。您希望将
numericId
选项重命名为indexId
之类的名称,以反映其新用途。然后,您需要添加一个采用数组值的indexLabels
选项。将其更改
为
:并为此添加另一个分支
:
并确保将所有位置的
numericId
更改为indexId
。还有其他一些if(options.numeric)
检查您也想更改为if(options.numeric || options.indexLabels)
但数量不多。您可能还想向作者发送补丁,这是礼貌的做法。
You'd have to modify the source. On the upside, modifying the source looks pretty straight forward. You want to rename the
numericId
option to something likeindexId
to reflect its new purpose. Then you'd add aindexLabels
option that takes an array value.Change this:
to
And add another branch to this:
with something like this:
And make sure you change
numericId
toindexId
everywhere. There are a couple otherif(options.numeric)
checks that you'd want to change toif(options.numeric || options.indexLabels)
too but not many.You'd probably want to send a patch to the author as well, that would be polite.