A
A
Alex Sokol2017-11-17 12:41:13
Qt
Alex Sokol, 2017-11-17 12:41:13

How to make the non-main page of the site open when opened on a smartphone or tablet?

How to make it not open the main page of the site when opened on a smartphone or tablet?
Is it possible to implement this through html meta tags
I'm trying to do JS
var w=$('document').width();
if(w<=750){
window.location.href="/products/";
}
the transition occurs, but the problem is that the page starts to reload, I suspect due to pagination.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ighor July, 2019-08-27
@NiKoTiN1

1) Override class and stub method with override

protected:
    void wheelEvent(QWheelEvent * event){}

2) Do the same with eventFilter
https://www.opennet.ru/docs/RUS/qt3_prog/x3974.html

A
Alexander Sharomet, 2017-11-17
@sharomet

I think that you need to determine from the beginning what devices came from and then redirect to the desired page.

function isMobileDevice() {
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
if(isMobileDevice()) {
window.location.replace("http://....com/products/");
или
window.location.href = "http://....com/products/";
}

Something like this)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question