What could be the reason for my slider not being responsive?

Struggling to create a responsive slider using Bootstrap? You're not alone. Check out the code below and let me know what I'm missing. If there's a better way to do this, feel free to share some tutorial links.

HTML

<div class="container">
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xm-12 col-lg-12 img-responsive">
            <div id="slideShow"></div>
        </div>
    </div>
</div> <!-- container -->

CSS

#slideShow {
}

#slideShow img{  
    position: absolute;   // if i delete then the slider becomes responsive the images don't work as a slide  //
    opacity: 0;
    left: 20%;
    -webkit-transition: 1s;
    -moz-transition: 1s;
    -o-transition: 1s;
    transition: 1s;
}
#slideShow .current{
    opacity: 1;
}
body{
    padding-top: 50px;
}

JavaScript

window.onload = function(){    
    /* code for image slideshow  */
    var imgsrc = ["1.jpg", "2.jpg", "3.jpg", "4.jpg"];
    for(var i = 1; i<=imgsrc.length; i++)
    {
        var slideShow = document.getElementById("slideShow");
        var newImage = new Image();
        newImage.src = "image/" + imgsrc[i];
        slideShow.appendChild(newImage);   
    }
    slideShow.childNodes[0].setAttribute("class","current img-responsive");
    var x = 0;
    setInterval(function(){
        slideShow.childNodes[x%3].setAttribute("class","img-responsive");
        slideShow.childNodes[(x+1)%3].setAttribute("class","current img-responsive");
    x++;
    },3000);  
    /* end of code for image slideshow  */   
};  // end of window onload function

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 reason behind the delayed mutation of the state when invoking the setState method in React?

Currently diving into the Forms section within the documentation of ReactJS. Just implemented this code snippet to showcase the use of onChange (JSBIN). var React= require('react'); var ControlledForm= React.createClass({ getInitialState: f ...

Discover the locations where a mesh and a plane intersect using Three JS

After creating a three.js scene with a plane intersecting a mesh, I am trying to retrieve an array of points where the mesh's edge crosses the plane. Despite searching for solutions, I haven't found anything helpful so far. Please refer to the i ...

The media query designed for iPads with a minimum width will also be effective for Android devices

As I delve into the realm of editing CSS created by others, I come across a peculiar situation involving media queries specifically designed for iPads. While one query is intended for portrait orientation and another for landscape, they are causing havoc o ...

How to Trigger a Django View Using Ajax

I am working on integrating Ajax with Django to trigger an action upon button click. I have successfully invoked the JavaScript function, but I am facing issues in calling the Django view. Despite no errors being displayed, the print statement within my vi ...

Using NextJS to Load Fonts from a Database

I've implemented a feature in my NextJS and Tailwind CSS app that allows users to select a theme with different color schemes and font options. The fonts available are all from Google Fonts. However, I'm facing an issue with loading the selected ...

I am looking to connect this piece of javascript to a button on the webpage

<script> var data; function getData() { data = prompt("What year would you like the data for?"); showData(data); } function showData(data) { if (data == 1901) { alert("26 thousand per million for males and 23 for females "); ...

A simple way to clear an input type=number field with JavaScript when clicked by the user

Currently, I am experimenting with the implementation of a numeric input field using the <input type="number" ...> and the list option to display a predefined set of 'favorite' values while still allowing users to input other valu ...

Tips on aligning a span element at the center of an image without losing its mouseover

<div class="pic"> <img src="image.jpg" height="250"/> <span class="text" style="display:none">text here</span> </div> <scriptsrc="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </scrip ...

Watching for changes to an object's value in an AngularJS service triggered by a controller from a separate module (Extended Edition)

Referring to this discussion on Stack Overflow: AngularJS trigger and watch object value change in service from controller The original question was about watching for changes in a service from a controller. I am interested in extending this concept to ...

Troubleshooting issues with the save method in PUT Requests using Node.js, Express, and Mongoose

When attempting to send a PUT request, Node.js throws an error stating: TypeError: product.save is not a function (referring to the save method in controllers/product.js) I believe that I am using the correct format to update a document, but unfortunate ...

Executing an AJAX request when the window is closed using jQuery

I have a clear question: how can I trigger an ajax call when the user clicks on the browser close button, but before actually closing the window? Are there any possible solutions for this specific scenario? I do not want any confirmation boxes - just a w ...

Issues with submitting a Django form using AJAX

I am experiencing an issue with the URL when trying to create a "like button" using AJAX. Whenever I click on the button, I receive a 404 error with the following URL: 'add_like'%20%%7D. The server console responds with "POST /questions/get/1/%7B ...

Arrangement of a pair of elements within a single sequence

Can someone help me align the text and icons (login, shop) to be at the same level as the 'Logo,' but on the right side? I attempted to adjust the '.shop-icon' with {margin: -30px auto;}, but it ended up messing up the entire page layou ...

Issue with jQuery AJAX parsing The response is not in the

I've been struggling with a small jQuery script that is supposed to pull JSON from a website on my domain. No matter how long I work on it, I just can't seem to get it right. Whenever I set the "dataType" as json, I receive a status error of 0. H ...

What is the best method in jQuery to populate a div's content with an array of values?

I have an array that I am splitting using toString in a previous function (func1), and then passing the values into my current function (func2). Inside func2, I need to take each of those values and append them to the end of a div ID like this document.get ...

Activate the Scrolling Feature in Angular Version 7

I am facing an issue with Angular 7 where scrolling is disabled for some unknown reason. I am not sure if this problem is related to using router-outlet or something I have implemented in the CSS. Below, I am sharing the code for one of my components. All ...

Having trouble with Window.open on Mobile Devices and Canvas?

I've created a unique "button" within the div element. This button is designed to detect user interaction, such as clicks or taps, and when triggered, it should open a new window with the URL: "http://www.google.com". However, while this functionality ...

Steps for rendering Emoji in React Application

I'm looking to integrate emojis into my webpage within a React chat app. The idea is to provide users with a list of emojis to choose from. How can I use codes like '1F683' to display emojis on the page, particularly with support for Chrome? ...

Key-Value Pairs in a Multidimensional Array using JavaScript

After making an AJAX request to a JSON, I receive the following code as a response: { total: "1", items: [ { id: 43, title: "ThisIsTheTitle", promoted: false, sticky: false, weight: 10, created: { timest ...

Monitoring a folder using webpack

Currently, I have webpack set up in my development environment to bundle all of my dependencies. To help concatenate various js files and include them in a script tag within the markup, I am utilizing the webpack-merge-and-include-globally plugin. Althoug ...