当我点击任何使用fancybox的东西时,我需要它为它生成一个特定的URL,因此当我将此链接发送给某人时,它会打开我想要的特定框.
例如: fancybox.net/home 当我点击第一张图片时,链接仍然是fancybox.net/home 我希望当我点击图片时,会生成URL并显示在地址栏中,如:fancybox.net/home/imageid = 1 所以当我发送fancybox.net/home/imageid=1给某人时,它已打开框中的图像
谢谢!
(就像Facebook照片一样,当您点击任何照片时,照片会在一个方框中打开,但地址栏会更改为图片链接)
//////更新#1 //////
我做了肯尼迪的建议,但经过一个小时的尝试,我仍然不知道为什么盒子不一样.
看看之间的差异:
代码:
<script type="text/javascript">
var thisHash = window.location.hash;
$(document).ready(function() {
if(window.location.hash) {
$(thisHash).fancybox({
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
arrows : true,
nextClick : true,
helpers : {
thumbs : {
width : 80,
height : 80
},
title : {
type : 'inside'
},
buttons : {}
},
afterLoad : function() {
this.title = (this.index + 1) + ' …Run Code Online (Sandbox Code Playgroud) 我正在构建一个SaaS,用户可以在其中创建自己的网站(如Wix或SquareSpace).这就是幕后发生的事情:
要创建新数据库并建立连接,请执行以下操作:
ActiveRecord::Base.connection.execute("CREATE DATABASE #{name}")
ActiveRecord::Base.establish_connection(<dynamic db data>)
Run Code Online (Sandbox Code Playgroud)
然后我通过执行以下操作在db中执行sql代码:
sql = File.read(sql_file.sql)
statements = sql.split(/;$/)
statements.pop
ActiveRecord::Base.transaction do
statements.each do |statement|
connection.execute(statement)
end
end
Run Code Online (Sandbox Code Playgroud)
然后我重新建立与主db的连接:
ActiveRecord::Base.establish_connection :production
Run Code Online (Sandbox Code Playgroud)
如何在没有数据库冲突的情况下同时处理许多用户创建网站?
换句话说,如何establish_connection并行使用多个数据库?
注意:它与通过database.yml连接到多个数据库不同.这里的目标是同时连接和断开多个用户对动态创建的数据库的连接.
mysql database activerecord connection-pooling ruby-on-rails
我需要同时使用它们(fancybox按钮助手和缩略图助手)
我一次只能使用其中一个.
以下是每个功能的示例:http: //fancyapps.com/fancybox/#examples
已经尝试过使用这两个类:
<a class="fancybox-buttons fancybox-thumbs"
Run Code Online (Sandbox Code Playgroud)
但它不起作用......一次只有一个,如:
<a class="fancybox-buttons"
Run Code Online (Sandbox Code Playgroud)
要么
<a class="fancybox-thumbs"
Run Code Online (Sandbox Code Playgroud)
.
这些是每个的javascripts:
/*
Button helper. Disable animations, hide close button, change title type and content
*/
$('.fancybox-buttons').fancybox({
openEffect : 'none',
closeEffect : 'none',
prevEffect : 'none',
nextEffect : 'none',
closeBtn : false,
helpers : {
title : {
type : 'inside'
},
buttons : {}
},
afterLoad : function() {
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length …Run Code Online (Sandbox Code Playgroud) 我试图将一个工具提示放在一个Popover中,它不起作用.
在popover之外,它100%工作.
就像那样:http: //www.finecolor.com.br/novo 首先尝试上面的菜单工具提示,然后点击Contact并尝试工具提示......
有任何想法吗?
我需要在我的应用程序中安装一系列库,将它们保存在各自的文件夹中 /vendor/plugins/
例如,ckeditor 库:
/vendor/plugins/ckeditor//vendor/plugins/ckeditor/js/Chart.js/vendor/plugins/ckeditor/css/chart.min.css这样我就可以像这样导入到我的 application.scss 中:
*= require chart.min
Run Code Online (Sandbox Code Playgroud)
在我的 application.js 中是这样的:
//= require Chart.js
Run Code Online (Sandbox Code Playgroud)
当我尝试这样做时,rails 只访问文件夹/vendor/assets/plugins/插件,产生错误:
could not find file 'chart.min' with type 'text/css'
Run Code Online (Sandbox Code Playgroud)
如何让项目扫描所有供应商的子文件夹,直到找到我要导入的文件?
fancybox ×2
jquery ×2
activerecord ×1
button ×1
database ×1
helper ×1
hyperlink ×1
javascript ×1
mysql ×1
popover ×1
ruby ×1
thumbnails ×1
tooltip ×1
vendor ×1