Alexandru Vlas
Alexandru Vlas

Reputation: 1415

Joomla site - show a message if the user who entered has a small screen resolution

I would like a message to be shown to users who enter on my site from a for example < 1100px width screen resolution.

Can somebody PLEASE help me with this.

Thanks

Upvotes: 0

Views: 180

Answers (1)

Joseph
Joseph

Reputation: 119837

here's an article that detects the viewport (the space of the inside of the browser) rather than the screen size.

as for Joomla, i insert "quick fix scripts" inline, or externally linked, into the template that is currently in use.


provided in that snippet in the article, you have 2 variables you can use:viewportwidth and viewportheight

if you want to alert if width < 1300, insert this after the script provided above:

if(viewportwidth<1300){
    alert('not large enough');
}

Upvotes: 2

Related Questions