jQuery Super-sized Not Expanding Vertically

I am facing an issue with resizing a 1920x1200 background image using jQuery Supersized. Whenever I resize the browser, there is a gap that appears vertically instead of filling up to compensate for the width constraint.

I have checked and copied the settings from another user who has a similar 1920x1200 image that resizes perfectly. But for some reason, it's not working for me. What could be the missing piece in my setup?

Let's start by looking at the CSS code below where the height/width are set to 100%:

* {
    margin: 0;
    padding: 0;
}

#supersized a {
    background: none repeat scroll 0 0 #111;
    height: 100%;
    left: 0;
    overflow: hidden;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: -30;
}

#supersized a.activeslide {
    z-index: -10;
}

And here is the JS code snippet I am using:

<link media="screen" type="text/css" href="css/master.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js" type="text/javascript"></script>
<script src="js/supersized.core.3.2.1.min.js" type="text/javascript"></script>

<script type="text/javascript">

            jQuery(function($){

                $.supersized({

                        //Functionality
                    slideshow : 0,
                    autoplay : 1,
                    start_slide : 1,
                    random : 0,
                    slide_interval : 6000,
                    transition : 1,
                    transition_speed : 500,
                    new_window : 1,
                    pause_hover : 0,
                    keyboard_nav : 0,
                    performance : 1,
                    image_protect : 1,
                    image_path : 'img/',
                    min_width : 0,
                    min_height : 0,
                    vertical_center : 1,
                    horizontal_center : 1,
                    fit_portrait : 1,
                    fit_landscape : 0,
                    navigation : 0,
                    thumbnail_navigation : 0,
                    slide_counter : 0,
                    slide_captions : 0,

                    slides  :   [ {image : 'example.com/image.png', title : 'Test'} ]
                });
            });

        </script>

Answer №1

After our discussion and your latest question, I have created a fiddle that does not center the content. Check it out here: http://jsfiddle.net/manishie/35qc7yht/

To make adjustments, focus on the following code:

horizontal_center: 0, // left align background

I recommend checking my updated fiddle to understand how it should be done correctly. Remember to place all JavaScript in the appropriate section, exclude unnecessary html and body tags, include jQuery using the sidebar menu, and add external resources like the supersized library also accessible through the sidebar menu.

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

What steps are involved in creating a mobile web app using Visual Studio 2012, jQuery, and ASP.NET MVC?

As a beginner in asp.net, I am tasked with creating a mobile web app project. Before diving into development, I would like to first focus on designing my app. Can anyone provide guidance on how I can achieve this? Any help is appreciated. ...

choose exclusively the text within the elementor navigation menu

I've been tinkering with this issue for a few hours now. I have a vertical Elementor navigation menu and I'd like to add a hover effect to it. So far, I can only select the entire column and apply the effect to that, not just the length of the t ...

Is there a way to format a block of text so that right-to-left text aligns to the right, while left-to-right text aligns

I have a content block that includes text in both left-to-right and right-to-left languages, and I need to ensure that both display correctly. If the user begins with left-to-right text, it should be displayed from left to right with left alignment If the ...

What is the best way to transfer JavaScript variable values to Drupal PHP variables?

I need assistance with passing a JavaScript variable to a Drupal PHP variable and displaying its value. Here is the code I currently have: $form['title'] = array( '#type' => 'select', '#title' => t('t ...

JQuery is unable to interpret JSON containing the character c-cedilla

Issues with jQuery Parsing JSON Response with French Characters The request made using jQuery for JSON data is as follows: $.ajax({ url: "retrieve", dataType: 'json', success: function (x) { }, error: function (jqXHR, textStatus ...

Overflow of nested item within flex container

I'm trying to make the content under "foo" fully scrollable, but I've been unsuccessful using flexbox. I attempted it with min-height, yet it didn't work out. Check out this JSFiddle for reference $('.ui.dropdown') .dropd ...

Adjusting the background color of an individual element within a grid using CSS

<div id="56c46f8385953" class="mg_box mg_pre_show col1_3 row1_3 m_col1_2 m_row1_3 mgi_14 mg_pag_1 mg_gallery mg_transitions mg_closed " rel="pid_14" mgi_w="0.333" mgi_h="0.333" mgi_mw="0.5" mgi_mh="0.333" > <div class="mg_shadow_div"> ...

Using jQuery AJAX to send data containing symbols

When making an AJAX call, I am including multiple values in the data like this: var postData = "aid="+aid+"&lid="+lid+"&token="+token+"&count="+count+"&license="+license; postData = postData + "&category="+category+"&event_name="+e ...

Challenges with loading content on the initial page load using the HTML5

Upon page load, I wanted to save the initial page information so that I could access it when navigating back from subsequent pages. (Initial Page -> Page2 -> Initial Page) After some trial and error, I ended up storing a global variable named first ...

Issues with the History API in AJAX Requests

Recently, I have come across a dynamically generated PHP code: <script> parent.document.title = 'Members | UrbanRanks'; $("#cwrocket_button").click(function(){ $("#module").load("modu ...

Creating a loading mask for a section of a webpage using angularjs

How can I implement a loading mask/image for a $http request that loads data for a <select> tag on my webpage? I want the loading mask/image to only cover the specific section of the page where the data is being loaded. Here's the HTML code: & ...

Utilize jQuery to extract all values from the second cell of a table and store them in an array

I have a task that involves pushing numbers from text boxes into an array. These text boxes are located in the second cell of each table row, while the third cell contains a date picker. Currently, the code snippet provided retrieves all values from both ...

How to access an element inside a div using the eq() method

Within my #img_wrapper, I have multiple pictures each enclosed in a link: <div id="img_wrapper"> <a href="img1.jpg" style="display: none;"> <img src="img1.jpg" /> </a> <a href="img2.jpg" style="display: none;"> &l ...

What is preventing Django from upgrading to a newer version of jQuery?

One issue I have encountered is that many Django admin plugins come with their own version of jQuery, which can cause conflicts when trying to use them together. For example, I've run into this problem with django-markitup and django-sortable. Is th ...

Enhance your Django webpage with real-time updates using AJAX technology

[Revised for Clarity and Detail] The challenge I'm facing is related to the architecture of my project. I have multiple ideas on how to achieve my goal, but I'm stuck on identifying the correct or most efficient approach. To provide more context ...

The Viadeo Social Toolbox seems to be encountering technical difficulties at the moment

I attempted to utilize a Viadeo Social Toolbox, specifically the Viadeo Share Button, but it seems to be malfunctioning in certain browsers? I came across some outdated viadeo share URLs like this: http://www.viadeo.com/shareit/share/?url=${url}&title ...

Stopping form submission on a jQuery form

I am in the process of implementing a password control feature on a login form using jQuery and ajax. This is the current script I have: $(document).ready(function() { $("#login-form").submit(function(e) { var csrftoken = getCookie('csr ...

Resolve the issue of autofill data overlapping with field labels

My form incorporates the Canada Post AddressComplete tool, which functions similarly to Google Maps Autocomplete. As you type your address, suggestions appear in a drop-down menu. However, after selecting an address, the text in the Postal Code and City f ...

Troublesome problem encountered when sending a JSON object to a C# method, specifically when the method requires a collection as a parameter and is being handled

Encountering a peculiar issue when passing the given data: queueNotificationData = { StartDate: that.batchData.StartDate.valueOf(), StartTime: that.batchData.StartTime.valueOf(), EndDate: that.batchData.EndDate.valueOf( ...

Storing jQuery output in a global variable can be achieved by assigning the result

Take a look at the Code snippet below - $(function() { $.fn.getPosition = function() { var results = $(this).position(); results.right = results.left + $(this).width(); results.bottom = results.top + $(this).height(); return results; } ...