文本动态更新后 Cufon 不显示

发布于 2024-12-06 14:09:37 字数 268 浏览 5 评论 0原文

我目前正在使用 WP-ecommerce 插件在 WordPress 中构建一个电子商务网站。在产品页面中,库存会在您选择属性(尺寸、颜色等)后更新。它基本上显示产品是否有库存。页面加载时文本得到cufon,但是库存更新后,即选择一个属性,测试突然失去了cufon以及侧边栏中的小购物车。我不知道是什么导致了这个问题。您可以在这里查看该网站:http://tinyurl.com/43pd8br。感谢您的帮助!

I'm currently building an e-commerce site in wordpress using the WP-ecommerce plugin.In product page, the stock is updated after you select an attribute(size, color etc). It basically shows if the product is in stock or not. The text gets cufon when the page loads, but after the stock is updated, that is you select an attribute, the test suddenly loses cufon as well as the small shopping cart in the sidebar. I have no idea what is causing the problem. you can see the site here : http://tinyurl.com/43pd8br . Thanks for helping!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

背叛残局 2024-12-13 14:09:37

文本更新后,您需要再次调用 cufon。与 CSS 不同,CSS 将样式应用于当前和未来页面与选择器匹配的任何元素,Cufon 是 JS,这意味着它响应事件。

当您第一次加载页面时,您正在应用 cufon - 因此它会找到所有匹配的元素并执行其操作,然后就完成了。当您在没有页面加载的情况下更新文本时,cufon 不会意识到这一点 - 据了解,它已经完成了它的工作并且已经完成。

因此,您需要做的是回调 - 在动态更新文本的脚本中,在更新发生后添加 cufon 操作。

You'll need to call cufon again after the text is updated. Unlike CSS, which applies a style to any element matching the selector now and in the future of the page, Cufon is JS, meaning it responds to events.

When you first load your page, you are applying cufon - so it goes and finds all the matched elements and does its thing, then it's done. When you update your text without a page load, cufon is not aware of this - as far as knows, it's done its job and has finished.

So what you need to do is a callback - in the script that dynamically updates your text, add your cufon actions once the update has happened.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文