Man, the way you’re doing all this seems really complicated to me because you don’t try to simplify?
To know which gallery was selected you could do something like this:
<ol>
<li class="galeria" data-galeria="casais">Casais</li>
<li class="galeria" data-galeria="gravidas">Grávidas</li>
<li class="galeria" data-galeria="criancas">Crianças</li>
<li class="galeria" data-galeria="bebes">Bebês</li>
</ol>
And to load the galleries that are being clicked you do the following:
$(document).on("click", ".galeria", function()
{
var galeriaSelecionada = $(this).data("galeria");
$('#conteudo').load('galeria.php?galeria=' + galeriaSelecionada,
function(){
$('#gallery a').lightBox();
}
);
});
I don’t understand what your code example has to do with the question: if you already have a value for
prodId
, just use it. But if you don’t have it, and want to recover from URL current, then why are you gonna make a call withload
to the same URL? Please explain better what your question is.– mgibsonbr
@mgibsonbr of a check in my site http://rafaelaalves.com/pjax/ when I enter the gallery it lists all the galleries, but when I select some it opens the same but when I click to open a photo via lightbox it opens the image normally, and able to put the received URL code in the
prodId
I can make a second page that makes this function appear– Cristiano Cardoso Silva
I still don’t understand... Anyway, you’ve tried using
window.location.search
? Look forgaleria=
in this text, soon after will be its value (followed by a&
, of a#
or the end of the string). P.S. I opened your site in Chrome, and if I click a gallery, it goes to the right gallery...– mgibsonbr