0
On the page of a product there are two links: 1 with the amount of comments that already exist for the product and another saying "Write a comment". Further down on the page there is a "tab" tab with the comments part. When you click on the link it triggers the comments tab, but it doesn’t slide the screen until then it looks like the link doesn’t even do anything. What needs to be done to make this link have these two functions at the same time?
Note: I have tried to simply put #tab-review on href DOES NOT WORK
Link Code:
<a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;"><?php echo $reviews; ?></a> / <a href="" onclick="$('a[href=\'#tab-review\']').trigger('click'); return false;"><?php echo $text_write; ?></a></p>
Page link: https://www.lupmed.com.br/bandagem-dynamic-tape-preto-5
Doesn’t work :(
– Ciano Barbarossa
Then it may be that onclick is preventing href... tries to put by your jQuery on onclick: window.location.href='#tab-review';
– Alisson Pelizaro
Didn’t work :(
– Ciano Barbarossa
Caraca bixo, a third alternative I see is to use scrollTop in your onlick... $('html, body'). scrollTop(0); Ai exchanges '0' for the amount of pixel you want to scroll down.
– Alisson Pelizaro
how does it exactly?
– Ciano Barbarossa
I’ll add a new answer here, Father.
– Alisson Pelizaro