So when user clicks a button I want to open a popUp, depending on the width of the page I want to resize the popUp accordingly.
Found a tasty wee example How to detect responsive breakpoints of Twitter Bootstrap 3 using JavaScript?
// Executes only in XS breakpoint
if( viewport.is('xs') ) {
// ...
}
// Executes in SM, MD and LG breakpoints
if( viewport.is('>=sm') ) {
// ...
}
// Executes in XS and SM breakpoints
if( viewport.is('<md') ) {
// ...
}
Problem is viewpoint is firing as not defined
Uncaught ReferenceError: viewport is not defined
at <anonymous>:1:1
but I have included it in my head
<!--Viewport-->
<meta name="viewport" content="width=device-width, initial-scale=1">
I have also moved the bootstrap scripts from the head to the body.
Does anyone have any idea whats wrong? ta