0

enter image description here

I have a requirement to display popup shown in Desktop view to be changed into new page in mobile view. Any ideas?

er_Yasar
  • 132
  • 10
  • Yes you can do that using javascript, first of all try and implement how to detect device using JS and then on that basis either open modal or redirect the user to a new page. [This](https://stackoverflow.com/a/3540295/9564225) will help you. Thanks. – Mohd Tabish Baig May 23 '18 at 10:09

2 Answers2

0

Using css to redesign the modal when in mobile view is an option I recommend.To do this you'll need to have some knowledge about media queries in css.So you will have to use media queries to re-adjust the width and height and the proportion of its contents on a mobile device. For more information about css media queries visit this site. https://www.codecademy.com/learn

Fred Rawllings
  • 142
  • 1
  • 13
0

Best you can do is probably have the modal take up the whole screen on mobile, using position: absolute and setting top, right, bottom and left to 0.

.modal {
  background: green;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

@media(min-width: 800px) {
  .modal {
    top: 20%;
    bottom: 40%;
    left: 20%;
    right: 20%;
  }
}
<div class="modal">hi</div>
syberen
  • 559
  • 3
  • 16