Add a count feature

Permalink Browser Info Environment
Hi,

Please can you tell me how to add a counter to the slider. I am new to concrete and JavaScript. For example 1 of 9.

Regards.
amnthony

Type: Discussion
Status: New
Tonero21
View Replies:
Mikel replied on at Permalink Reply
Mikel
Hi Anthony,

We already replied to your support message with a solution for your needs. Anyway, we post here in the forum so everyone is able to access this solution:


------------------------ QUOTE ------------------------

If we understood correctly, the problem hides in showing a counter with no user control over it just to inform wich slide is actually showing.

In that case, since our Slider is designed to work with scrapbook content, the solution could be as simple as entering the count as part of the content/image of the slide (note: since you can show any kind of content, you could mix up two different images into one single element).

Otherwise, you could code a solution into your own slide by editing the file view.php:

You just need to insert a new element into the "cycle" function called "before" and set a callback function:

before: name,


Then you can code a javascript function called "name" which makes the work for you:

first = true;
function name(curr,next,opts) {
    var slide;
    var total = opts.slideCount;
     if(first){
         slide = 1;
    first = false;
     }else{
        slide = opts.nextSlide + 1;
     }
     var caption = slide + ' of ' + total;
     $('#yourowndivid').html(caption);
}



We hope you find usefull this possible solution, feel free to ask if you find any problem with it.

Sincerely,

USERTIC

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.