2
I have a project here with a problem, I’m close to solving but I need a hand from you!
At Home, we have a button called "Covers" that when clicked should be taken to the Developments page.
On this page, we have a Portfolio-Filter plugin, where in principle all the properties are shown, and if the user click on any category, for example: 1 bedroom, 2 bedrooms ...... roofs, then only the properties of this type stay on the screen with an effect disappearing the others in fadeToggle form().
But the url is not changed by clicking these filters, usually a #Category appears in the url, but in this case no.
I did the following:
- On the Home Covers button, I call the URL: http://site .with . br? type=covers
- Then jQuery searches in the url the string "type=covers", this is already ok.
- Now I need that when this happens, force a click (I don’t know if it’s possible) without the user clicking, in the Covers filter.
Tips??
Follows code:
$(document).ready(function () {
if(window.location.href.indexOf("?tipo=coberturas") > -1) {
alert("Opa, encontrou.");
var filtroCoberturas = $('li a[data-filter*="cobertura"]');
//Agora aqui preciso fazer a LI selecionada ser clicada automáticamente
}
});
It is possible, as the answer already posted shows. But if you created the button click action yourself, it might be more elegant to do otherwise.
– bfavaretto