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 6379523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:08:58+00:00 2026-05-25T02:08:58+00:00

I have a slide gallery which adds a class curSlide to an image when

  • 0

I have a slide gallery which adds a class curSlide to an image when it is being displayed within the gallery.

I have divs containing text corresponding to the slides within the gallery, ie. #group2-text should be displayed when a .group2-img has the class curSlide. Both gallery-text divs are set as display: none within the css. Is it possible to get jquery to display the correct div depending upon the curSlide class?

html:

<div class="page-content" id="projects-commercial-content">
  <div class="gallery" id="projects-commercial-gallery">
    <div class="gallery-holder">
      <div id="projects-commercial-slides" class="slides"> 
        <img id="comm1" src="images/commercial1.jpg" class="slide-image group1-img" alt=""/>
        <img id="comm2" src="images/commercial2.jpg" class="slide-image group1-img" alt=""/>
        <img id="comm3" src="images/commercial3.jpg" class="slide-image group1-img" alt=""/>
        <img id="comm4" src="images/commercial4.jpg" class="slide-image group2-img" alt=""/>
        <img id="comm5" src="images/commercial5.jpg" class="slide-image group2-img" alt=""/>
        <img id="comm6" src="images/commercial6.jpg" class="slide-image group2-img" alt=""/>
      </div> 
    </div><!--gallery-holder-->
    <div class="gallery-text" id="group1-text">
      <h3>project <span class="abbrev">group 1</span></h3>
      <p>Group 1 description text. Suspendisse ultricies molestie nisi id bibendum. Mauris bibendum ipsum at massa malesuada eu venenatis velit pretium.</p>
    </div>
    <div class="gallery-text" id="group2-text">
      <h3>project <span class="abbrev">group 2</span></h3>
      <p>Group 2 description text etc. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse imperdiet justo ac ligula congue posuere. Aliquam erat volutpat </p>
    </div><!--gallery-text-->
  </div><!--gallery-->
</div><!--page-content-->

The part of the gallery js adding the class is here:

    _fade: function (navigateData) {

            // put hidden to slide above current
            this.slides.eq( navigateData.to ).addClass('curSlide').css({
                zIndex: 10
            // fade in next
            }).fadeIn(this.options.fade.interval, this.options.fade.easing, $.proxy(function(){

                    // hide previous
                    navigateData.currentSlide.removeClass('curSlide').css({
                        display: "none",
                        zIndex: 0
                    });                             

                    // reset zindex
                    this.slides.eq( navigateData.to ).css({
                        zIndex: 0
                    });                 

                    this.current = navigateData.to;

                    this._trigger("navigateEnd", ( this.current + 1 ), this);

            }, this));
    },

I didn’t write the gallery js and I’m not really sure how to adapt it to display the corresponding div/text.

Any help is much appreciated! Please let me know if more details are required. TIA!

  • 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-05-25T02:08:58+00:00Added an answer on May 25, 2026 at 2:08 am

    I haven’t tested this, but give it a try. Modify the part of the gallery script

    _fade: function (navigateData) {
    
            //hide text and show new text
            $('.gallery-text').css('display','none');
            var curImgClass = $(this.slides.eq( navigateData.to )).attr('rel');
            $('#' + curImgClass + '-text').css('display','block');
    
            // put hidden to slide above current
            this.slides.eq( navigateData.to ).addClass('curSlide').css({
                zIndex: 10
            // fade in next
            }).fadeIn(this.options.fade.interval, this.options.fade.easing, $.proxy(function(){
    
                    // hide previous
                    navigateData.currentSlide.removeClass('curSlide').css({
                        display: "none",
                        zIndex: 0
                    });                             
    
                    // reset zindex
                    this.slides.eq( navigateData.to ).css({
                        zIndex: 0
                    });                 
    
                    this.current = navigateData.to;
    
                    this._trigger("navigateEnd", ( this.current + 1 ), this);
    
            }, this));
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a XML image gallery, which displays text in between each slide.
I have an image gallery which works great. When the last slide is reached
I have an image gallery which loads a detail image, then draws a line
I have an image gallery app that has a slider to control the width
This is what I have and it works: $(function(){ $('.slide-out-div').tabSlideOut({ tabHandle: '.handle', //class of
I am using asp.net and C#. I have a image and three line. Which
I have a Gallery, which has an adapter connects to it. In the getView
I am creating an image gallery where there are 9 list items per slide
I'm making an image gallery and I want to have a bunch of thumbnails
I am attempting to create an image gallery. At the bottom I have a

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.