High-quality images appear fuzzy on Android devices while remaining clear on iPhones when using Lightview modals

The images in my Lightview modals, displayed as .png and .jpg, appear blurry on Android devices but not on iPhones. The modals and images are automatically sized based on the viewport dimensions.

HTML (Generated by Lightview)

<div class="lv_window">
   <div class="lv_content">
      <div class="lv_content_wrapper">
         <img class="lv_content_image" />
      </div>
   </div>
</div>

CSS

.lv_window {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: 0;
  overflow: hidden;
  text-align: left;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  display:block;
  /* Width, height, top, and left adjust dynamically based on viewport */
}
.lv_content {
  position: absolute;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: url('somegif.gif');
  display: block;
  /* Width, height, top, and left adjust dynamically based on viewport */
}
.lv_content .lv_content_wrapper {
  float: left;
  clear: both;
  position: relative;  
}
.lv_content_image {
  float: left;
  border: 0;
  clear: both;
  padding: 0;
  margin: 0;
  background: none;
  /* Width and height adjust dynamically based on viewport in pixels */
}

I assign a source (src) to each image using MVC depending on the selected state. All other CSS and HTML is generated by Lightview.

I've reviewed similar issues like Blurry images on stock android browser, but I don't have any z-index or position: fixed set. The problem occurs specifically on the default Android browsers version 4.0.4, 4.1.2, and 4.2.2 on Samsung Galaxy S3 and S4 (as reported by our testers).

I attempted setting float: none for the .lv_content_image class in Lightview's CSS, but it didn't improve the image quality.

I will provide an example image as soon as possible.

Answer №1

Encountering an unusual glitch with the S3 model. To resolve this issue, simply apply both of these properties to the image tag:

opacity: 0.999999;
-webkit-backface-visibility: hidden;

The same solution unfortunately triggers an error on the S4 device, despite both devices sharing the same screen dimensions of 320×640. As opposed to creating precise pixel-based @media stylesheets, you can implement the following workaround:

var ua = window.navigator.userAgent.toLowerCase();
window.platform = {
    ...
    isS3: ua.match(/gt\-i9300/i) !== null
}
if (platform.isS3) {
    $('img').css{
        'opacity': 0.9999,
        'webkitBackfaceVisibility': 'hidden'
    }
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Fragment encountering difficulty in receiving broadcast intent

I am encountering the following error: 04-17 09:35:10.227: E/AndroidRuntime(9377): java.lang.RuntimeException: Error receiving broadcast Intent { act=com.aldakur.instalacionesdep.services.action.FIN flg=0x10 } in com.aldakur.instalacionesdep.info.RssAviso ...

What is the best way to align the 5th and 6th list items to the left using CSS?

I am experimenting with Bootstrap to create a customized navbar. I am encountering difficulties in aligning the login and logout buttons to the right. Is there a way to achieve this? I have included my HTML and CSS code below: HTML code: <body> &l ...

The anchor tag fails to function properly when nested within an image element inside an animated container

As I am currently developing a solar system webpage, my aim is to redirect users to a specific page when they click on a planet. Unfortunately, the anchor tag does not seem to be functioning as intended. I attempted to animate the anchor tag with an image, ...

What is the best way to ensure that my website functions properly on Safari mobile?

I successfully created a website that functions well on my computer across all modern browsers. However, a user reported that it is not working on Safari mobile. Upon testing the website on Safari for Windows, it appeared to display correctly. After view ...

How can the color of the <md-toolbar> be customized?

Here is a glimpse of how my code appears on CodePen: I am aiming to have the background color of "Sidenav Left" match that of "Menu Items", which is designated by the class .nav-theme { background-color: #34495E } I attempted to override it like this ...

Utilizing HTML5's geolocation API to construct a geofence

Is there a way to utilize the HTML5 geolocation API to determine if a user is located in a specific area? I'm considering setting a central latitude and longitude and creating a radius around it, so the site will function as long as the user is within ...

Generate interactive jQuery slideToggle containers that monitor user clicks via Google Analytics

I have been working on a PHP and mySql project where I need to retrieve a list of businesses from a database. Once I have the desired businesses, I want to display them consecutively inside their own "clickDiv" container using jQuery slideToggle to reveal ...

Button with a Jquery icon design

Hello, I am currently working on implementing an icon button that can collapse and expand text. Although I have successfully implemented the logic for collapsing/expanding, I am facing difficulties in creating the actual icon button. The theme I am require ...

Perform the same actions on every element within the ul li

I'm facing an issue with my unordered list, where each list item contains a span element with an image inside. My goal is to set the background-image of each span to be the same as the image it contains, while also setting the opacity of the image to ...

What is the best way to ensure that less2css compiles all files after saving just one less file?

In my project, I have a style.less file that imports "page.less". Whenever there is a change made to page.less, I find myself having to go back to the style.less file and save it in order for less2css to compile and apply the changes. If not, the changes ...

The KeyboardAvoidingView disrupts the structure of the flexbox layout

Check out this code snippet: return ( <KeyboardAvoidingView style={{ flex: 1 }} behavior="padding" enabled> <View style={style.flex1}> <View style={style.imageContainer}> <Image style={style.image} ...

What is the best way to insert a scroll into a section of a circular shape seamlessly?

Currently, my layout looks like this: https://ibb.co/iqaOXS However, I would like it to look more like this: https://ibb.co/eDkCRn The issue I'm facing is that the buttons are extending beyond the circular border. How can I prevent this from happeni ...

Issues with appending new rows using JavaScript

I'm facing an issue with adding rows to the table using this code and I can't seem to find a solution. function add() { document.getElementById("popup").style.display = "block"; document.getElementById("add").addEventListener("click", func ...

activate a "toggle" that allows selection of specific components to show

<span id='question'>{{QuestionText}}</span> <br> <form action={{address}}> {% for each in AnswerQuery %} <span>{{each.answer}}</span><input type='radio' name="answer"> <span>Votes:{{each.a ...

Stop the bootstrap navbar from resizing

I implemented a bootstrap navbar that looks like this... <nav class="navbar navbar-inverse"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">WebSiteName</a> </div& ...

Tips for transforming numerical date data into a string format

Is there a method to convert the numeric month in a table into a string format? <table style="width: 100%;"> <tr> <th>Date</th> <th>Total</th> </tr> <tr> <td id="date ...

The spinning progress dialog stops when the AsyncTask completes

I have been attempting to integrate a ProgressDialog into an AsyncTask to display a spinning animation while loading some information. However, I've encountered a problem where the spinning motion stops suddenly, giving the impression that the app is ...

The "pointer" cursor style is simply not functioning in any way

Here is the angular template code I am working with: <!-- Modal --> <ng-template #levelsmodal let-c="close" let-d="dismiss"> <div class="modal-header"> Select the levels you want to show in the table and chart ...

Make a div come alive with animation when hovered over

I'm trying to achieve a rotating effect on a div when the cursor hovers over it, similar to what is shown in this video. My preference is to utilize keyframes for this animation as they offer more customization options. div.myElement { ... a ...

What is the best way to convert this PHP string into an image?

Is there a way to replace the string "Overview" with an image instead? If it's possible, how can I achieve this? if (empty($lang) || !is_array($lang)) { $lang = array(); } $lang = array_merge($lang, array( 'UCP_MAIN' => 'Ov ...