-
AuthorPosts
-
June 12, 2015 at 11:15 am #458288
Hi,
I’d like to know if it is possible to have a direct link to a portfolio grid where one set item is already open, in the ajax view.
Thanks
June 13, 2015 at 9:45 am #458714Hey adetec_ing!
Thank you for using Enfold.
Add this in the functions.php file to trigger click event for the first portfolio grid item on page load:
function ava_auto_click_portfolio() { ?> <script> (function($){ $(window).on('load', function(){ $('div .isotope-item:first-child .grid-image').trigger('click'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_auto_click_portfolio');
Cheers!
IsmaelJune 15, 2015 at 12:50 pm #459257Thanks for your answer, but I need to select one or another, depending on the link. For example:
http://www.example.com/ajaxgrid#item4
I guess that if not directly, it could be achieved with a POST or a GET, but I’m quite bad with jQuery and don’t know to modify this part.
Thanks.
June 16, 2015 at 8:24 am #459882Hi!
I guess you need something like this: https://kriesi.at/support/topic/linking-to-filtered-portfolio-ajax/#post-430830
You can change the javascript there with the code above. And use nth-child selector to choose which items to open, example, “div .isotope-item:nth-child(4) .grid-image” for the 4th item. The code is a bit cumbersome and can be improved so I suggest hiring a freelance developer to create new script for it. You can visit codeable: http://kriesi.at/contact/customization
Regards,
IsmaelJune 18, 2015 at 2:22 am #461024Hi, thanks for the information, although I’m not sure if this nth-child would work as the order may change.
Using an id or class based selector would be perfect, so I guess this should work:function ava_auto_click_portfolio() { ?> <script> (function($){ $(window).on('load', function(){ $('.post-entry-1111 .grid-image').trigger('click'); }); })(jQuery); </script> <?php } add_action('wp_footer', 'ava_auto_click_portfolio');
Can’t test it right now, but I think it would work.
- This reply was modified 9 years, 5 months ago by adetec_ing.
June 18, 2015 at 6:39 am #461104This may work for you:
https://kriesi.at/support/topic/create-a-link-to-an-open-gallery/#post-427405Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.