M
M
Max Developer2017-05-06 14:49:01
PHP
Max Developer, 2017-05-06 14:49:01

Opencart, how to set up a transition from a website to a landing page?

Previously, there was a full-fledged site, but now they decided to convert it into a landing page, the question is banal, but still, how to remove the page reload function for the anchor menu and some links on the page?
thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dummyman, 2017-05-06
@maximviktorovich777

A little bit of a mess.

// '.menu a' я написал от балды, подставь значение верстки как у тебя в шаблоне карта
document.querySelector('.menu a').addEventListener('click', function(event){
   event.preventDefault();
   event.stopPropagation();
   this.href; // По этому параметру можешь определить до куда скролиться
             // то есть, какую именно ссылку нажали
   document.body.scrollTop; // Меняя значение этой переменной 
                          //страница проскролится до узказанных пикселей
   // Плавный scrollTo() можно найти в интернетах.
})

Just keep in mind that the search engine will see the link to the page. Most likely, if the user searched for a product, the search engine will send the user to the product page and not to the category showcase page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question