我使用的是 Rails 4
我有一个打开 colorbox 的链接。重新加载页面时,颜色框将打开。但当我单击个人资料链接然后单击同一链接时,它不会打开。
我的链接是<%= link_to "Upload Image", edit_seller_banner_users_path, class: "open-file-select1 photobox"%>
我的 js.coffee 是
$(document).ready ->
openFileForm = ->
$(".photobox").colorbox
width:"40%"
height:"40%"
escKey: false
overlayClose: false
loadMethods = ->
openFileForm()
loadMethods()
$(window).bind "page:change", loadMethods
请帮忙..
最佳答案
也试试这个
openFileForm = ->
$(".photobox").colorbox
width:"40%"
height:"40%"
escKey: false
overlayClose: false
$(document).ready ->
openFileForm()
$(document).on 'page:load', ->
openFileForm()
关于jquery - 通过 Turbolink 访问页面后,colorbox 弹出窗口未打开,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18146698/