3

Building an image gallery with Responsive & Filterable jQuery Portfolio Gallery Plugin - Elastic Grid found HERE--> http://www.jqueryscript.net/layout/Responsive-Filterable-jQuery-Portfolio-Gallery-Plugin-Elastic-Grid.html

Got this in a separate linked js file...

{
                    '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']
                },

Can anyone point me in the right direction on how to make this Live Preview link open in a new window please?

Philip G
  • 4,098
  • 2
  • 22
  • 41

3 Answers3

1

I know this is a bit old, but looking at the latest source I see that this feature is now supported (as well as that there was never an answer accepted).

You would need to write your code similarly to as follows:

...
{
    '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' ]
}
...

Please notice the newly added 'new_window': property in the first object of the button_list array.

I hope that this helps those in the future who go looking like I did, to more quickly - and easily - find the answer.

Rik
  • 676
  • 7
  • 11
0

This plugin you have found does not support opening up links in new windows.

However editing the elastic_grid.js that comes with the code, as shown below would solve your issue.

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);
   }
}
Harshadewa
  • 21
  • 6
0

Thaks so much. Got it working…

In the “elastic_grid.js” …this is the code that did the trick…

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);

                    }
                }

You are awesome! Thanks! Kevin