[英]Custom top-bar back text in ZURB's Foundation
When I add this code to my application.js it doesn't work properly. 当我将此代码添加到application.js时,它无法正常工作。 I displays 2 more 'custom_text' button and it keeps there the original 'back' button. 我再显示2个“ custom_text”按钮,并将其保留在原始的“ back”按钮中。
$(document).foundation()
.foundation('topbar', {
index : 0,
stickyClass : 'sticky',
custom_back_text: true,
back_text: 'custom_text',
init : true
});
How could be that fixed? 那怎么解决?
Foundation Topbar现在支持数据选项,例如。
<nav class="top-bar" data-section data-options="back_text: 'custom_text'">
The problem is that you are initializing two times the foundation script. 问题是您要初始化两次基础脚本。 You can fix it in this way: 您可以通过以下方式修复它:
$(document).foundation('topbar', {
index : 0,
stickyClass : 'sticky',
custom_back_text: true,
back_text: 'custom_text',
init : true
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.