Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7908875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:08:01+00:00 2026-06-03T12:08:01+00:00

I’m trying to build a basic slider in jQuery. I have 5 primary sections

  • 0

I’m trying to build a basic slider in jQuery. I have 5 primary sections that display on a page, and when you hover over their container div, then arrows pop up on the first and last elements.

My next step is to write code that will store the div (either left or right depending on click side) in an array, and remove it from the DOM. However, I’m having trouble tying into the click event.

Here’s my css:

.left_arrow_background {
 height: 175px;
width: 65px;
/* background:url(../images/left-arrow.png) no-repeat; */
background:#ccc;
opacity: .9;
position: absolute;
cursor: pointer;
z-index: 2;
}

.right_arrow_background {
height: 175px;
width: 65px;
/* background:url(../images/right-arrow.png) no-repeat;*/
background:#ccc;
z-index: 2;
opacity: .9;
position: relative;
left:890px;
cursor: pointer;
}
.boomers_scroller {
height:275px;
padding-left:1px;
display:block;
border-bottom-width: 1px;
border-bottom-style: solid;
border-bottom-color: #CCC;
    overflow:hidden;
}
.all-boomers {
display: block;
float: left;
height: 225px;
margin-bottom: 20px;
margin-left: 20px;
width: 175px;
}

And the HTML that’s output:

<div class="all-boomers">
<a href="/boomers/profile/id/2"><img src="/images/users/medium_thumbs/4fa44866c3561.jpg" alt=""/></a>
      <p class="boomers_name">PC Guy</p>
      <p class="activity_name">IT Guy PC Repair</p>
    </div>
<!-- three more identical section here -->
<div class="all-boomers">
<a href="/boomers/profile/id/6"><img src="/images/users/medium_thumbs/4fa62dff64c44.jpg" alt=""/></a>
      <p class="boomers_name">Cruella Deville</p>
      <p class="activity_name">Dalmation Dog-Sitter</p>
    </div>

Even when removing z-index from the style sheet, I can’t seem to record a click event. Here’s my js file so far:

$(document).ready(function() {

  var boomers = $('.all-boomers');
  var boomersLength = boomers.length;
  var boomersContainer = {};
  $(".all-boomers:eq(4)").attr('id','right-boomer');
  $(".all-boomers:eq(0)").removeClass("all-boomers").addClass("one-fifth first").attr('id','left-boomer');
  var image_left = '<div class="left_arrow_background"></div>';
  var image_right = '<div class="right_arrow_background"></div>';

  $(".boomers_scroller").hover(  
    function(){
        $(image_left).insertBefore('#left-boomer');
        $(image_right).insertAfter('#right-boomer');
    },
    function(){
        $('.left_arrow_background').remove();
        $('.right_arrow_background').remove();
    });

  $("div.left_arrow_background").click(function(){
    var left_boomer = $('#left-boomer').children();
    // store left_boomer in boomerscontainer, then remove it from dom
    console.log('clicked!');

  });
 });

It’s not just click events… I’ve tried other mouse events as well, and nothing triggers the console test message, or if I put code inside the .click function, it won’t trigger the code.

Edit: added a 4th (relevant css style)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T12:08:02+00:00Added an answer on June 3, 2026 at 12:08 pm

    Fixed! The hover event is still occuring when I’m clicking, so nesting the click event inside the hover event clears up the issue.

    $(document).ready(function() {
    var boomers = $('.all-boomers');
    var boomersLength = boomers.length;
    var boomersContainer = {};
    $(".all-boomers:eq(4)").attr('id','right-boomer');
    $(".all-boomers:eq(0)").removeClass("all-boomers").addClass("one-fifth first").attr('id','left-boomer');
    var image_left = '<div class="left_arrow_background"></div>';
    var image_right = '<div class="right_arrow_background"></div>';
    $(".boomers_scroller").hover(       function(){ 
         $(image_left).insertBefore('#left-boomer');
         $(image_right).insertAfter('#right-boomer');
         $("div.left_arrow_background").click(function(){
               var left_boomer = $('#left-boomer').children();
              // store left_boomer in boomerscontainer, then remove it from dom
              console.log('clicked!');    });
     }, 
    function(){ 
        $('.left_arrow_background').remove();
         $('.right_arrow_background').remove();
     });
     }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.