使用响应式&amp ;;构建图库可过滤的jQuery Portfolio Gallery插件 - 弹性网格在这里找到 - > http://www.jqueryscript.net/layout/Responsive-Filterable-jQuery-Portfolio-Gallery-Plugin-Elastic-Grid.html
在一个单独的链接js文件中得到这个...
{
'title' : 'WBIR.com Remake',
'description' : 'Detailed Description Goes Here',
'thumbnail' : ['images/small/39.jpg'],
'large' : ['images/large/39.jpg'],
'button_list' :
[
**{ 'title':'Live Preview', 'url' : 'http://dkdesigns.us/aiu/uploads/web/k_downey_ip5_vcdd330/index.html',},**
],
'tags' : ['Web']
},
有人能指出我在正确的方向上如何在新窗口中打开此实时预览链接吗?
答案 0 :(得分:1)
我知道这有点旧,但是看看最新的来源,我看到现在支持此功能(以及从未接受过答案)。
您需要编写类似于以下内容的代码:
...
{
'title' : 'WBIR.com Remake',
'description' : 'Detailed Description Goes Here',
'thumbnail' : ['images/small/39.jpg'],
'large' : ['images/large/39.jpg'],
'button_list' :
[
{
'title': 'Live Preview',
'url': 'http://dkdesigns.us/aiu/uploads/web/k_downey_ip5_vcdd330/index.html',
'new_window': true,
},
],
'tags': [ 'Web' ]
}
...
请注意button_list数组的第一个对象中新添加的'new_window':
属性。
我希望这能帮助那些看起来像我一样的人,更快 - 更容易 - 找到答案。
答案 1 :(得分:0)
您找到的此插件不支持在新窗口中打开链接。
但是,编辑代码附带的elastic_grid.js,如下所示将解决您的问题。
if(urlList.length > 0){
for (i = 0; i < urlList.length; i++){
var ObjA = $('<a target="_blank"></a>');
ObjA.addClass('link-button');
if(i==0){
ObjA.addClass('first');
}
ObjA.attr("href", urlList[i]['url']);
ObjA.html( urlList[i]['title']);
this.$detailButtonList.append(ObjA);
}
}
答案 2 :(得分:0)
非常多。 搞定了......
在“elastic_grid.js”中...这是完成这个技巧的代码......
if(urlList.length > 0)
{
for (i = 0; i < urlList.length; i++)
{
var ObjA = $('<a target="_blank"></a>');
ObjA.addClass('link-button');
if(i==0){
ObjA.addClass('first');
}
ObjA.attr("href", urlList[i]['url']);
ObjA.html( urlList[i]['title']);
/* ObjA.attr("target", "_blank"); */
this.$detailButtonList.append(ObjA);
}
}
你太棒了! 谢谢! 凯文