Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
Imitate click with jQuery to get filtered multigallery by URL

I have website, created with Elementor. Website belongs to photographer. He has got there an Elementor Multigallery, with filter at the top. I need to create external links, which can bring you to the subpage and directly show only filtered items.

Here's the link to multigal: https://chosephoto.com/photo/

I need to do something like that, when I enter the https://chosephoto.com/photo/#fashion I will received the current subpage, but it will shows only images from gallery "fashion". Not all images.

I thought about imitating jQuery click by query string (get the value of /#....) and then do the jquery click the with attribute, which equals the value in query string, However I even don't know, how can I do it with jQuery. I am jQuery beginner.

Thank you for a help.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

So, finally, here's my "solution"

$ = jQuery;
$(window).bind('load', function() {
    var hash = $(location).prop('hash').substr(1);
    if(hash == 'portrait') {
        $('a[data-gallery-index=0]').trigger('click');
    } else if (hash == 'fashion') {
        $('a[data-gallery-index=1]').trigger('click');
    } else if (hash == 'product') {
        $('a[data-gallery-index=2]').trigger('click');
    } else if (hash == 'sky-photo') {
        $('a[data-gallery-index=3]').trigger('click');
    } else {
        $('a[data-gallery-index=all]').trigger('click');
    }
});

I had to use .bind('load'), instead of document.ready() function, because the gallery do the additional javascript after the document is ready (and it has overwritten my code).

You can call the filter with getting the URL, based on the hashtag at the end. For example this URL: https://chosephoto.com/photo/#fashion will filter the FASHION gallery.

My knowledges are not enough, to do it better way. But it works!

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda