All the slides in Owl Carousel blend into one seamless display

I'm experiencing an issue with the owl carousel. I want to create a one slide owl carousel, but all my images are displaying as one slide vertically stacked on top of each other instead of horizontally as intended.

<div id="owl-demo" class="projects-slider owl-carousel owl-theme">

        <div class="item"><img src="img/lisi1.jpg" alt="lisi"></div>
        <div class="item"><img src="img/lisi2.jpg" alt="lisi"></div>
        <div class="item"><img src="img/lisi3.jpg" alt="lisi"></div>
        <div class="item"><img src="img/lisi3.jpg" alt="lisi"></div>

    </div>

CSS

.owl-carousel .item img {
        display:block;
        width:100%;
        height:auto;
    }

    .owl-carousel .item {
        margin:0px;
    }

JS

$(document).ready(function() {

        $('.projects-slider').owlCarousel({
            navigation : true,
            slideSpeed : 300,
            paginationSpeed : 400,
            singleItem:true,
            pagination: true,
            items: 1,
        });

    });

https://i.sstatic.net/ER8fc.jpg

https://i.sstatic.net/8ra0P.jpg

Answer №1

Give this a shot: [For version 1.3.3 with jQuery 1.9.1]

Adjust the owl.carousel.js in line 754

doTranslate : function (pixels) { 
        var tmp_pixi = 0;
        tmp_pixi = (pixels % 1553);
        return {
            "-webkit-transform": "translate3d(0px, " + tmp_pixi + "px, 0px)",
            "-moz-transform": "translate3d(0px, " + tmp_pixi + "px, 0px)",
            "-o-transform": "translate3d(0px, " + tmp_pixi + "px, 0px)",
            "-ms-transform": "translate3d(0px, " + tmp_pixi + "px, 0px)",
            "transform": "translate3d(0px, " + tmp_pixi + "px,0px)"
            };           
    },

Note : this 350 will determine the image height... you can either set it statically or fetch it dynamically using jquery

Answer №2

Your current Owl Carousel version is outdated and not compatible with the latest jQuery.

We recommend switching to a 2.x version of jQuery for optimal performance.

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

Alpha Screen and Shading Filter

Having trouble with CSS filters in IE8. I have a div with a gradient background that needs to have opacity set to 0, and when hovered over, the opacity should change to 1. Here's my code: #myDiv { filter: alpha(opacity=0); opacity: 0; background:rgba ...

Methods for parsing a jQuery Ajax response object without the need for a loop

Consider the following jQuery AJAX request: $.getJSON("getSearchSystems.php", {level: "full", data:this.label}, function(data){ //This method is unsuccessful. console.log(data.regionName); console.log(data.constellationName); console.l ...

Has anyone figured out the issue with Uplodify? It suddenly ceased to function

For some time now, I've been using uplodify without any issues. Unfortunately, as of yesterday, it suddenly stopped working. I'm at a loss as to what might have caused this sudden change. Could someone please offer me some assistance? I've ...

Limiting the number of input tags to a maximum of 5

I am using a jquery tags plugin and need help to restrict the number of tags to a maximum of 5 words separated by spaces. Can someone assist me with this? Below is the original code for the plugin: (function($) { var delimiter = new Array(); jQuery. ...

Is there a way to block form submissions for users who have disabled JavaScript?

Our inquiry form mandates users to input basic information such as their name, location, contact details, and a comment or question. Unfortunately, we have been receiving numerous incomplete forms where essential fields are left blank. It has come to our ...

Jest does not support util.promisify(setTimeout) functionality

While I understand there may be similar questions on SO, I believe mine is unique and hasn't been addressed in the current answers. I'm currently experimenting with testing a REST API in Express.JS. Below, you'll find a basic working exampl ...

How can I receive a response from node.js-express and send it back to AJAX?

Although I am comfortable in PHP, I decided to learn node.js in order to enhance the efficiency of my chat application. As a beginner in node.js, I am currently facing a specific issue. My goal is to send a request to node.js from AJAX using jQuery and re ...

Achieving 100% height in a div container using flex while maintaining vertical centering

Struggling to center text and buttons using flexbox while keeping the columns equal? Setting column height as 100% can be a challenge. If you set the height to 100%, vertical alignment may no longer be centered. Avoid resorting to tables or JavaScript for ...

Maintaining responsiveness, CSS grid will automatically adjust the height of each element to be equal

I am facing an issue with my grid layout. Each element in the grid has an image and other divs below it. The problem arises when the screen size changes, causing the elements to scale automatically due to responsive width. I want all the images to have the ...

Failure of Ajax POST requests to refresh screen content

Within my "scenario", I have numerous "forms" that consist of various "events," "data," and more. To populate all this information, I've included the following script to run once the page has fully loaded: $(document).ready(function() { var scenarioI ...

I feel like I'm stuck in a never-ending loop of COR issues that are blocking my progress on

My main focus is establishing a direct connection between a computer and a Raspberry Pi within a local network. It's important to clarify that this project will never have any connection to the internet. The Raspberry Pi is running a NodeJS server th ...

Find items where a certain value matches any of the values in another array and return them

I'm seeking assistance with a specific task. I have an object structured as shown below: SOMEKEY: { "key1": val1, "key2": val2 } Additionally, I have an array that contains string values like this: [stringA, stringB, stringC ...

Delivering create-react-app's build files through an express server

I am trying to serve the build files of my React app on another Express application. I have copied all the static files from the build folder to the public folder inside my Express application and have set up the following code: app.use(express.static(pat ...

JavaScript Objects: Where am I going astray?

I encountered an issue while working on a coding exercise. Whenever I attempt to submit my code, I receive the following error message: SyntaxError: Unexpected string var movieObj = { "Toy Story 2": "Great story. Mean prospector.", "Finding Nemo": "Co ...

Help Needed: Adding a Simple Element to jQuery Tabs Script

I recently came across a fantastic jQuery tabs script on a website called Tutorialzine. The link to the article can be found here. As I was implementing this script, I realized I needed to customize it by adding specific classes to certain tabs. Specifica ...

The Cordova Android app is experiencing issues with Ajax requests

While testing my project on the Chrome browser, the AJAX requests were functioning properly. However, upon installing the app on an Android device, the requests stopped working altogether. Below is the code snippet used: var xhr = new XMLHttpRequest() ...

New approach for jQuery.load(); Introducing a stop function to halt the loading operation

I am seeking guidance for a dilemma I am facing. Despite my efforts to find a solution, I have not come across any posts addressing the exact issue I am encountering. While some discussions mention using .bind() to disable a link, my situation involves mul ...

Guide on embedding .ascx control into .aspx page seamlessly without triggering a postback or refreshing the page

I'm currently working with some code that is functioning well. I'm looking to create a cookie and have the .ascx control load in order to execute a specific function on the cookie without causing the page to post back. What is the best way for me ...

Leveraging a Keyframes Definition from an External Source

Font Awesome has a special spin animation for elements that have the class fa-spin. Taking a closer look at the CSS code, you can see that the spinning effect is achieved through keyframes under the same name, fa-spin. Instead of creating a new animation ...

Tips for avoiding the automatic transition to the next slide in SwiperJS

How can I prevent the next button click in swiper based on my custom logic? I am using the swiperjs library within a Vue project and I need to stop users from swiping or clicking the next button to move to the next slide depending on certain conditions de ...