ContentFlow

I am using ContentFlow from http://www.jacksasylum.eu/ContentFlow/

It is very well documented on their website.

I got the whole thing working great on my site.

What I don’t know is how to change the ActiveItem onclick to just bump it over to the next image as if the next image had been clicked.

As of right now it opens the image source in a self window. I don’t want that.

Can anyone give me a clue or maybe the whole answer on how to get it to click over to the next image? :slight_smile:

I believe the answer lies in the contentflow_src.js file.

Yeah, it didn’t work. I still clicks to the singular image on a blank page.

I hope I figure it out soon.

It seems like no matter what I do with the script, it always does the same thing.

I wish they would get back to me, I contacted them about it before I even posted here.

Thanks, although I previously tried that and variations thereof and it did not work. I will give it another try since we both drew the same conclusion.

You could try modifying the script to something like the following:

Change:


onclickActiveItem: function (item) {
            var url, target;

            if (url = item.content.getAttribute('href')) {
                target = item.content.getAttribute('target');
            }
            else if (url = item.element.getAttribute('href')) {
                target = item.element.getAttribute('target');
            }
            else if (url = item.content.getAttribute('src')) {
                target = item.content.getAttribute('target');
            }

            if (url) {
                if (target)
                    window.open(url, target).focus();
                else
                    window.location.href = url;
            }
        },

to something like the following:


onclickActiveItem: function (item) {
            [COLOR="Red"][B]this.moveToIndex('next');[/B][/COLOR]
        },

You might need to add some logic for it to work on the last item of the collection.

k! Figured it out! There were 2 javascript files being called. I did this in the header:

<script language=“JavaScript” type=“text/javascript” src=“ContentFlow/contentflow_src.js”></script>

<!–<script language=“JavaScript” type=“text/javascript” src=“ContentFlow/contentflow.js”></script>–>

Now it goes to the next image on click just like I wanted!!

Turns out it was calling the exact same script twice and the one being adjusted should be the only one being called. Otherwise any changes would simply be reverted back to the unedited script. It took a while for me to realize they where the same script because one was neatly formatted and the other was all jumbled together.

The script change you gave me helped, too! Thanks a lot!

I have tested it and it works fine. Since I have it already set for continuous loop it just goes to the first image automatically once you click on the last image. All is well! Thanks again!

I was wondering why it was all jumbled together… Does it save that much space in a file size to have it that way?

This is because contentflow.js is the minimized version of the file (to reduce its size), so effectively you were calling the same script twice.

Glad you solved your problem!