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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:36:01+00:00 2026-06-14T15:36:01+00:00

I was able to get jQuery Cycle to dynamically generate the images I want.

  • 0

I was able to get jQuery Cycle to dynamically generate the images I want. However, I am scratching my head on how to add a custom pager (using image sprites), title and caption box/watermark (opacy rgba(0.0.0.04) ) at the bottom-left corner of the slides.

The image array is already assigning the caption to the image’s alt and the title to the image’s title like so: <img src="banner[i].image" alt="banner[i].caption" title="banner[i].title" />

Here is the jsFiddle: http://jsfiddle.net/rkSqj/1/

I’d like to achieve something similar to http://slidesjs.com/examples/images-with-captions/
but I do not need the (Next/Prev) controls.

I can’t get the pager to show up, let alone the other customizations >_<
I’ll really appreciate your help.

Although I am using jsFiddle, I am still adding the code for convenience 😉

HTML:

<!-- #gallery.banner -->
    <div id="banner">
    </div>
<!-- /#gallery.banner -->

CSS:

@charset "utf-8";
#banner {
    width: 550px;
    height: 225px;
    float:left;
    box-shadow: -2px 15px 50px 10px #888888;
}
#banner a {
    margin: 0;
    padding: 0;
    color: #fff;
}
#banner img {
    width: 550px;
    height: 220px;
    border: 2px solid #DBDBDB;
    border-radius: 4px;

    padding: 4px;
    background-color: #F3F3F3;
}


/* Pager CSS */
#banner #pager.active {
    width:12px;
    height:13px;
    background:url(http://slidesjs.com/examples/images-with-captions/img/pagination.png) 0px -12px;
}
#banner #pager.inactive {
    width:12px;
    height:13px;
    background:url(http://slidesjs.com/examples/images-with-captions/img/pagination.png) 0px 0px;
}


/* Watermark CSS */
#banner #watermark {
    background-color: #000000;
    background-color: rgba(0.0.0.04);
}
#banner #watermark #title {
    color: #FFFFFF;
    font-weight: bold;
}
#banner #watermark #caption {
    color: #FFFFFF;
    font-weight: normal;
}

JS:
var $banner = ; //The whole data is within jsFiddle

$(document).ready(function(){
$().append(‘ ‘);

for( $i = 0; $i < $banner.length; ++$i){
    $('#banner').append('<a href="' + $banner[$i].link + '"><img src="' + $banner[$i].image + '" alt="' + $banner[$i].caption + '" titile="' + $banner[$i].titile + '" /></a>');
}

$('#banner').cycle( {
    fx: 'fade',
    timeout: 1500,
    speed: 4000,
    pager: "#pager",
});

});

=== EDIT (11/21/2012) ===

Final revission: http://jsfiddle.net/omarjuvera/WX77f/18/

Thanks @eicto !!!

  • 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-14T15:36:03+00:00Added an answer on June 14, 2026 at 3:36 pm

    Add a caption to your <a> element, make a css for caption

    sample

    JS:

    for( $i = 0; $i < $banner.length; ++$i){
            $('#banner').append('<a href="' + $banner[$i].link 
              + '"><img src="' + $banner[$i].image + '" alt="' + $banner[$i].caption + '" titile="'          
              + $banner[$i].titile
              + '" /><div class="caption" style="bottom:0">' 
              + $banner[$i].caption + '</div></a>');
        }
    

    CSS

    a .caption {
        margin-top: -10px;
        color:white;
        text-decoration: none;
        position: absolute;
        text-align: center;
        background: black;
        opacity: 0.6;
        width: 100%;
    }
    

    about pager, cycle have callback function to generate the pager, so i just generated same element that other plugin do:

    http://jsfiddle.net/oceog/rkSqj/14/

    $('#banner').cycle( {
            fx: 'fade', 
            timeout: 15000, 
            speed: 400,
            pager: "#pager",
            //build new pager!
            pagerAnchorBuilder: function(index,dom) {
            console.log(index,dom);
            return "<li><a href='#'>"+index+"</li>";
    }
    });
    

    CSS:

    #pager {
        margin:0px auto 0;
        top: 30px;
        width:100px;
        position: relative;
        z-index: 1005;
    }
    
    #pager li {
        float:left;
        margin:0 1px;
    }
    
    #pager li a {
        display:block;
        width:12px;
        height:0;
        padding-top:12px;
        float:left;
        overflow:hidden;
        background-image:url(http://slidesjs.com/examples/images-with-captions/img/pagination.png);
        background-position:0 0;
    }
    #pager li.activeSlide a {
         background-position:0 -12px;  
    }
    ​
    

    to html i just added <ul id="pager"></ul>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery getJSON with asp.net mvc controller... I cant able to get
I was able to get this working using jquery 1.6, but I upgraded to
I'm using the JQuery Cycle Plugin in an attempt to fade in/out images for
Can't seem to get this jquery gallery working. I've been able to get the
I am not able to get the hg head or status for a given
I am able to get the output of a pdf using fpdf, the problem
I'm not able to get intellisense to work with JavaScript/jQuery code in vs10. Not
I am using Jquery Date pickers to get Start and End Dates for an
I used to be able to get hold of $('[data-role=header]').first().height() in alpha with jQuery
I'm using ajax in wordpress to get the output of a function: jQuery.ajax({ type:

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.