Extending flexislider to cover the entire screen with adaptable images

The Dilemma

I'm currently facing a challenge while using the FlexSlider plugin to create a full-page slider similar to the one on the Suzy Hoodless website. My issue lies in trying to get the images within my slides to stretch and fit 100% of the height.

Progress Update

Fortunately, I was able to find a workaround for this problem with the following code:

Now, my aim is to ensure that the images are centered and cropped equally on ALL sides when the browser window is resized. Any suggestions?

<div class="flexslider-container">
<div class="flexslider">
      <ul class="slides">
            <li><img src="images/kitchen_adventurer_donut.jpg" /></li>
            <li><img src="images/kitchen_adventurer_caramel.jpg" /></li>
      </ul>
</div>

.flexslider-container, .flexslider .slides, .flex-viewport {
height: 100%;
width: 100%;
}

.flexslider {
position: absolute; 
margin: 0; 
padding: 0; 
width: 100%; 
height: 100%; 
overflow: hidden;
}

.flexslider .slides > li {
width: 100%; 
height: 100%; 
display: none; 
-webkit-backface-visibility: hidden; /* Hide the slides before the JS is loaded. Avoids image jumping */
}

.flexslider .slides img { 
min-width: 100%; 
min-height: 100%; 
display: block;
}   

Answer №1

If you want to optimize your images for better performance, consider using background-images instead of regular images along with the CSS property background-size: cover. Check out the code snippet below:

http://jsfiddle.net/2m8dtjLr/7/

.slideshow .items > div {
    background-size: cover;
    background-position: center;
    height: 100%;
    width: 100%;
    display: none;
    -webkit-backface-visibility: 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

Panel div fails to show visNetwork visualization

After experimenting with shinyLP for creating html elements and crafting network diagrams using visNetwork, an interesting observation was made. When visNetwork is placed in a well panel or without any panel at all, it displays properly. However, the issue ...

Managing iframe scrolling using the parent window's scrollbar

I am currently working on an iframe to be utilized across various domains. The functionality of this iframe involves displaying a data list that updates when the bottom of the scroll is reached. An issue I encountered is that the parent window, where the ...

Discover the method to retrieve every element from a Listbox with the click of a Button and utilizing an ajax call

How can I retrieve all the elements from a Listbox when a Button Click event triggers an ajax call? I have created a function that successfully returns all the elements from the Listbox. However, when I try to bind it with the ajax call, it doesn't w ...

Guide to Retrieving the Value of the Radio Button in Django

Welcome to my quiz app development journey! Here is a snippet from my HTML file: {% for question in questions %} <p>Q){{question.name}}</p> <input type="radio" value="1" name="{{question.id}}">{{question.o ...

Various results can be produced based on the .load() and .resize() or .scroll() functions despite using the same calculation methods

I'm currently working on developing my own custom lightbox script, but I've hit a roadblock. For centering the wrapper div, I've utilized position: absolute and specified top / left positions by performing calculations... top: _center_ver ...

Shifting Elements - Navigation triggers subtle movements in CSS styles as you move across pages

I've noticed a strange issue on my website where certain elements seem to be shifting slightly when navigating between different pages. Here's a quick video clip demonstrating the problem. It appears that these elements are not staying static as ...

Increase or decrease the input value by clicking on a button

Having an issue where the quantity value properly increases and decreases when clicking on the + or - button, but I also want the price to increment and decrement accordingly. I need to be able to adjust the price when clicking on the increase or decrease ...

How to delete the right part of a box shadow in CSS

I have a div with a box-shadow applied. I want to remove the right side of the shadow without adding any new code, but by modifying the existing box-shadow property. I attempted using clip-path, but I need it to also work on Internet Explorer. Can you prov ...

Is it possible to switch the summernote editor between airmode and toolbar mode?

Currently, I am working on creating a report editor that displays only one toolbar when multiple summernote WYSIWYG editor sections are used. My solution involves having the first section as a full editor and the other section in airmode. Below is the HTM ...

Error Handling with PHP's die() Command

There seems to be an issue that I am facing with the die() commands. On my website, I have a member registration page which includes a form. The form's action leads to another PHP script. However, when the form is submitted, instead of displaying an a ...

Bootstrap: enabling the opening of a modal without triggering the collapse feature on the parent element

Here's a simple scenario: I have a Bootstrap 4 table with rows that I would like to be clickable to expand additional hidden rows. The entire tr has data-toggle="collapse". However, within that TR, there are some buttons that I want to open ...

Move a component within a container based on the position of the mouse cursor upon entry

Is there a way to make an element slide into a div, but have its starting position vary? <div class="block"> <div class="hover">…</div> </div> If the user enters the div from the left, the element should slide in from the le ...

Python Spynner - Troubles with jQuery requests

Update: The initial issue has been resolved, but the code is still not functioning as expected. When tested in Chrome, it only inserts 'hi' into the password box. In Spynner, it just loads the page. I'm working on using Spynner to extract d ...

Is there a way to ensure that the vertical scrollbar remains visible within the viewport even when the horizontal content is overflowing?

On my webpage, I have multiple lists with separate headers at the top. The number of lists is dynamic and can overflow horizontally. When scrolling horizontally (X-scrolling), the entire page moves. However, when scrolling vertically within the lists, I wa ...

The dropdown feature in Materialize does not function properly when used within a dynamically generated card

Using the materialize dropdown example within a client-side html file and initializing it with jQuery is seamless: $('.dropdown-button').dropdown({ inDuration: 300, outDuration: 225, constrain_width: false, // Does not change w ...

The MVC framework coupled with a robust Javascript/JQuery validation library is a winning

Currently, I am involved in a project that utilizes MVC 2.0 along with Kendo UI. Our team has made the decision to utilize AJAX validation instead of MVC Model level validation. This means that validation occurs during most "onchange" events on HTML contro ...

Unable to attach an onClick event handler to <TableRowColumn> element using Material-UI in React

In the past, I had a feature that allowed me to change the color of the text from red to green by clicking on a table cell. After introducing Material-UI in my React app and replacing the <td> tags with <TableRowColumn> tags, I noticed that th ...

css: varying container heights for columns in Chrome and Safari using Bootstrap 4

In my code snippet below (this is just a prototype, in the actual application everything is different but follows a similar structure): <body> <div class="row"> <div class="col-3 d-none d-sm-block"> <div class="h-1 ...

How can I ensure my button aligns to the left with the element above in Bootstrap?

Here is a JSFiddle link for reference: https://jsfiddle.net/sf4wkyx0/ The alignment of my 'Add' button with the textarea seems slightly off: https://i.sstatic.net/r7lAn.png Both elements are within a container with the class col-2, but the al ...

Transforming the appearance of a clickable link when tapped

Is there a simple way in Bootstrap 5 to change the style of a clicked link to an "active" style while reverting the previously clicked link back to normal? Or is this something that would require custom CSS/JS? <ul class="nav nav-pills flex-column& ...