The Dropdown Menu and Slick Gallery are not intersecting

In my jQuery Slick Gallery, I have a Dropdown Menu that displays an unordered list of menu entries when a button is clicked. The issue I am facing is that the unordered list is hidden at the bottom edge instead of appearing above the dots as intended. You can see the problem in the image below: https://i.sstatic.net/glFYH.png

To see what I am trying to achieve, you can check out this example: http://jsfiddle.net/45cst6nq/

HTML

<section class="slider">
  <div>
    <ul class="list">
      <li>Please select</li>
      <li>Point 1</li>
      <li>Point 2</li>
      <li>Point 3</li>
      <li>Point 4</li>
      <li>Point 5</li>
      <li>Point 6</li>
      <li>Point 7</li>
      <li>Point 8</li>
      <li>Point 9</li>
      <li>Point 10</li>
    </ul>
  </div>
  <div>slide2</div>
  <div>slide3</div>
  <div>slide4</div>
  <div>slide5</div>
  <div>slide6</div>
</section>

CSS

$c1: #3a8999;
$c2: #e84a69;

.slider {
    width: auto;
    margin: 30px 50px 50px;
}

.slick-slide {
    background: $c1;
    color: white;
    padding: 40px 0;
    font-size: 30px;
    font-family: "Arial", "Helvetica";
    text-align: center;
}

.slick-prev:before, 
.slick-next:before {
    color: black;    
}

.slick-dots {
    bottom: -30px;
}

.slick-slide:nth-child(odd) {
     background: $c2;
}

.list {
  position: absolute;
  top: 0;
}

JS

$(".slider").slick({
    autoplay: false,
    dots: true,
    responsive: [{ 
        breakpoint: 500,
        settings: {
            dots: false,
            arrows: false,
            infinite: false,
            slidesToShow: 2,
            slidesToScroll: 2
        } 
    }]
});

This example demonstrates the issue I'm facing with the slick gallery. Although I've tried adjusting z-index and overflows, setting overflow-x: visible; seems to work but it makes the cloned slides also visible. On the other hand, using overflow-y: visible; does not resolve the problem. This inconsistency is confusing to me.

Is there a way to solve this issue without having to create a custom gallery from scratch?

Answer №1

The issue lies within the slick.list class. I have made some modifications to enhance the visibility of your Li elements. Implement the following changes to correct it:

.list li {
  background-color: white;
  color: black;
  border-bottom: 2px solid black;
}
.slick-list {
  overflow: visible;
}

Preview available at: http://jsfiddle.net/abc123/

Answer №2

It's not quite clear what your ultimate goal is.

A dropdown menu cannot be created using an unordered list, it requires the use of a HTML select element. I made some adjustments to your code by replacing the ul with a select and it appears to be working fine.

https://jsfiddle.net/o1prjfcw/2/

<section class="slider">
    <div>
      <select>
        <option value="point1">Point 1</option>
        <option value="point2">Point 2</option>
        <option value="point3">Point 3</option>
        <option value="point4">Point 4</option>
      </select>
    </div>
    <div>slide2</div>
...

You have the flexibility to customize the appearance of the select element to match the overall design of your webpage.

Answer №3

It seems like there may be some confusion regarding your question and what you are hoping to achieve. If you are looking to incorporate a list element into a slider, I recommend adding the following code to your CSS:

.slider div .list{
  position: relative;
}

By including this code, the list will display within the slide without impacting other slides.

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

This element is not compatible for use as a JSX component

I have created a React component which looks like this import React from 'react'; import { ECOTileSummary } from './ECOTileSummary'; import { TileSummary } from './TileSummary'; interface SuperTileSummaryProps { date?: s ...

Send the function with parameters, but do not pass its output

Within my component, there is a need property that holds a static function. This function is executed by middleware to handle asynchronous API calls before rendering the component. Here's an example: static need = [ myFunc(token) ] The issue arise ...

Understanding how objects are created using the reduce method

I'm curious about how the reduce function can transform an array into an object as shown in this example, particularly with the line: p[c[0]] = c[1]; Is this an unconventional syntax for creating key-value pairs that I haven't encountered before ...

Does NextJs <Link> not fire the beforeunload event? Wanting to warn the user before they navigate away from the page

How do I prompt the user before leaving the page? I have noticed that when the user enters the page from a standard link element, the beforeunload event is triggered when they click back. However, if the user enters the page through the NextJs Link compon ...

Building a ReactJS application that displays an array of images with a distinct pop-up feature for each image

Having trouble creating unique popups for each image in React. I have a set of 20 images that should be clickable, with only one popup open at a time, each containing text and an image. Currently mapping out the images from an array. Looking for assistan ...

Using Angularjs: Trigger Directive Execution Post Completion of ng-init Function

I'm facing an issue with calling a function in ng-init within my HTML file. The function is responsible for making an API call and collecting data, which is then assigned to a scope variable and passed to a directive. Initially, the controller gets e ...

I am encountering difficulty loading a .gltf file for use with Three.js on my React website

I uploaded my .gltf file of a 3D model to the public folder of my project and then ran the command "npx gltfjsx filename" to convert it into a .js React component. Within that .js file, I included the following line: const { nodes, materials } = useGLTF(&a ...

Is it possible to verify if a user is accessing a webpage through Electron?

If I were interested in creating a basic Electron application that notifies the user upon reaching example.com, is this achievable? If yes, then how can I determine if the user is on a particular webpage? ...

Having Trouble with the Bootstrap Responsive Menu Button Not Working

I'm struggling with the Bootstrap menu I created, as it's not collapsing or animating. Everything seems to be working fine except for the button that isn't functioning. <nav class="navbar navbar-expand-lg navbar-light bg-dark alb ...

Rails 7 is missing the Toast element from Bootstrap 5

Having some trouble with implementing Bootstrap 5 Toast in Rails 7 for flash messages. Here is the code I am currently using: # application.html.erb <head> ... <%= javascript_importmap_tags %> <script> const toastElList = document.que ...

Leveraging Flask Session with EventSource 2.0

Apologies for the confusing title. My aim is to create a Flask Page with AJAX integration to display dynamic content on the page while a Python program is running. I'm utilizing flask_oauthlib to obtain an access token for a REST API and then fetchi ...

What is the best way to leverage an existing user database and integrate user authentication into a fresh project?

I have recently taken on the task of revamping an established project by creating a brand new frontend from scratch. After careful consideration, I have opted to develop a straightforward Vue/Node.JS project. Within the current framework lies a Postgres d ...

Web application experiencing issues with electron loading and functioning properly

I attempted to load a web application in electron using window.loadurl and as a webview in html. The application is displaying, but encountering various errors such as: $ jquery not defined Uncaught TypeError: $(...).daterangepicker is not a function Unca ...

Switch from monochrome to color when hovering inside a clipping mask

I have successfully mastered the technique of changing an image from grey to color on hover using CSS and JavaScript. However, I am curious about whether it is possible to achieve the same effect using a clipping mask. Attached is an image that illustrate ...

What is the method for determining the dimensions of a cube?

Currently, I am working with a cube geometry and a mesh in my project. However, I am facing a challenge figuring out how to obtain the width of the cube. Below is the snippet of code that I am struggling with: geometry = new THREE.CubeGeometry( 200, 200 ...

Using ion-icon inside a clickable ion-card while applying float: right does not render properly

I am facing an issue with a list of ion-cards that have clickable icons appearing when you hover over them. The problem is that due to the floating nature of the icons, they are not positioned correctly (as shown in the image below) and end up getting cove ...

The application experiences a sudden failure when Mongoose is unable to locate the specified item

I am facing an issue where my app crashes when mongoose is unable to find the item. I want to display a 404 error page instead. Here is the code snippet: try { let theBeverage = Product.findOne({ _id: beverageId }); await theBeverage.then((data) ...

Is there a clash between ng-if and col col-50?

Currently, I am attempting to create a table using Angular code within HTML. The structure of the table is exactly how I want it to be, and here is the code snippet representing it: <div class="row"> <div class="col col-25">Date</div> ...

Tips for Avoiding Stripe Webhook Sending $0 Invoice Upon Trial Registration

Currently, I'm developing an app that offers a 14-day free trial period. For payment processing, I've integrated Stripe and set up webhooks to enable backend functions triggered by specific events. However, the issue I've encountered is th ...

I am having issues with my JavaScript code, I could really use some assistance

Currently, I am developing a custom file search program. The goal is to have a textarea where users can input text, which will then generate a clickable link below it. However, I am facing issues with the current implementation. Below is the snippet of my ...