Creating my very own slider

I'm currently working on a slider and encountering a few challenges.

1) The animation on the first slide isn't functioning as expected.

2) The spacing for the last box initially appears incorrect, but adjusts as the slider progresses.

3) I'm noticing occasional stuttering in the animations.

You can view the codepen here:

http://codepen.io/mpaccione/pen/MyJNxM

Any insights or advice would be greatly appreciated. I'm unsure why these issues are occurring. For the animation, I'm using CSS transitions and JavaScript/jQuery to manipulate the CSS/DOM calculations.

CODE

<style type="text/css">
    html,body {
        margin: 0;
        background-color: #888;
        height: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    #slider {
        width: 100%;
        height: 100%;
        display: block;
        position: relative;
        transition-duration: 0.5s;
        transition-timing-function: ease-in-out;
    }
    
    // Remaining CSS and JavaScript code included...

Answer №1

It appears that the margin problem stemmed from the browser rendering space due to the elements being inline-block. Browsers automatically add uneditable spacing.

The most effective solution I've come across is to set the parent of the ul to have a font-size of 0.

Another issue was the lack of animation on the first slide, which was caused by the absence of an initial css left value set for animation.

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 is the process for connecting an event to the <body> element in backbone.js?

Could it be done? For example, like this: ... interactions { 'click button' : 'performAction' } ... ...

The CSS property input::-webkit-outer-spin-button adjusts the margin-left and is exclusively visible in Chrome browser

Strange things are happening... Let me share the code for my inputs: #sign_in input#submit { height: 56px; background-color: #88b805; font-weight: bold; text-decoration: none; padding: 5px 40px 5px 40px; /* top, right, bottom, left ...

"Utilize the clickToggle or toggle functions in jQuery for seamless

Hello everyone, I've been working on a code to animate a box by toggling between show and hides states. However, I seem to be facing some issues and can't find the right solution. When I use a simple click function, it works fine, but I want to h ...

Passing data from a Vue.js component to a router in index.js

I am attempting to transmit a JWT token value from the component Login.vue and verify it in the router/index.js before directing the user to the next page. Login.vue: <script> import axios from "axios"; export default { name: "Login", m ...

Dealing with jQuery Validation is driving me crazy!

Hey there, I've been struggling with JQuery validation problems lately and nothing seems to be working. I've tried starting from scratch multiple times but still can't figure it out. The latest attempt can be found using the reference link b ...

How can you add padding to an HTML page using CSS?

I've been attempting to use padding-bottom:90px; in order to shift Tweets by ‎@StackOverflow (the entire tweets section) downwards on the page. I want to move it further down using the above padding, but it doesn't seem to be working for me. H ...

The term 'undefined' does not qualify as a function when analyzing the operation 'c.replace(bo,"-$1")'

Having some trouble with using jQuery effects to show or hide a div. Every time I try one of the following methods, an error pops up in the console. The animation runs successfully for the first time, but then the error appears in Safari console and I&apo ...

Component updates are not working in VueJS

My Vue 1 component requires an object as a prop that needs to be filled by the user. This object has a specific structure with properties and nested inputs. The component is essentially a modal with a table containing necessary inputs. I want to perform v ...

Steps for implementing a select all feature with jQuery

I'm currently working on a jQuery function that is acting as a select-all option. Everything is functioning correctly except that when I deselect any of the child elements from select all, the option remains enabled. My goal is to enable or disable th ...

Tips for maintaining a sticky header while continuing to utilize Bootstrap table classes such as table-responsive and table-stripped

This is Here's my code on jsfiddle I've attempted to make the header sticky while maintaining the current layout, but every approach I've tried ends up messing with the responsiveness of the table. My next plan involves using a JavaScript ...

There is an issue with the sorting function: [orderBy:notarray]. The expected input was an array

Looking to incorporate pagination functionality from this source: http://jsfiddle.net/SAWsA/11/ [ { "name": "Micro biology", "id": "2747c7ecdbf85700bde15901cf961998", "category": "Other", "type": "Mandatory - No Certification", "cate ...

Verify whether the chosen options from a dropdown list coincide with a predetermined value

I am working with a form that generates dropdown lists dynamically. <c:forEach var="companyList" items="${company.detailList}" varStatus="status"> <tr> <td>c:out value="${companyList.employeeName}" /></td> <td> <select ...

Challenges encountered while creating a Number Tables Program (such as displaying 12 x 1 = 12) using Javascript

Currently, I am working on developing a program that can generate mathematical tables for any given number. For example: 3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 3 x 4 = 12 To achieve this, the user should provide the following inputs: (1) The number they want ...

retrieve the value of a specific key using JSON stringify

[{"displayorder":"1","menuname":"DashBoard","menuid":"5","menuurl":"dashboard.php"},{"displayorder":"3","menuname":"Accounting Module","menuid":"3","menuurl":""},{"displayorder":"4","menuname":"My Profile","menuid":"4","menuurl":"myprofile.php"},{"displayo ...

How can the outer function be connected to the resolve method of $routeProvider?

Here is a functional code snippet: $routeProvider.when('/clients', { templateUrl:'/views/clients.html', controller:'clientsController', resolve: { rights: function ( ...

Guide on navigating through various HTML pages with distinct parameters using Node.js (Express server)

Seeking assistance with a Node.js server that receives an ID as a query parameter. Each time a client connects with different parameters, I aim to serve them a unique HTML page containing a simple UI with 2 dynamic arrays. Everything seems to be working co ...

Encountering issues with incorporating jquery functions into Ember.js

This piece of code was added to the index.ejs file: <script type="text/javascript> $(window).load(function() { $('#username').glDatePicker(); }); </script> However, the jQuery code only functions on the IDs of the ...

Executing MySQL query within DataTables server-side processing script

Utilizing DataTables server-side processing to retrieve data for a DataTables table from a MySQL database. This is the MySQL query that needs to be executed and shown in the DataTables table: $sql = "SELECT Client,EstimateNumber,Status,TotalEstimatedTime ...

Unable to retrieve module from directive template in Angular

I am currently working on creating a wrapper component for ngAudio. This wrapper will act as the player with controls and will interact with ngAudio's functions. However, I am facing some scope issues with it. I can inject ngAudio into the component&a ...

javascript issue with fetching data from URL using the GET method

Here is my attempt to fetch a JSON file from a server using asynchronous JavaScript promises. I am experiencing an issue where the result is undefined when using a specific URL, but it works when I use a different URL. Below is the working code with a dif ...