Hi, I'm looking for some sort of support or request feature here. I was wondering how I could make it so when the last image has been viewed, the page refreshes?

You see, I have made a slideshow for a nearby school for them to show on their tv screens around the school, like a powerpoint presentation you know. Everything works fine except if the teachers there update the slideshow with new material, they need to manually refresh the slideshow for it to show the new content - which they can't because they don't have access to that computer where the slideshow actually plays. Do you get the picture? So I would like the slideshow to refresh the page when it appears on the last one.

This is my code so far that I put in the header of my View:

drupal_add_js ('
$(document).ready(function() {
            $(".views_slideshow_singleframe_teaser_section div:last")(function() {
                location.reload();
            });
        });', 'inline' );

I need some kind of function where it's empty now. I've tried mouseleave, trigger and a couple of more to no avail. I also tried an if statement like this:

$(document).ready(function() {
            if ($(".views_slideshow_singleframe_teaser_section div:last") == .css("display", "block"));
                location.reload();
            });  

But it doesn't work, I'm sure I'm doing it wrong, I'm not that good with coding.

Comments

redndahead’s picture

Status: Active » Fixed

You can add your own method in advanced options where you replace the after method and check to see if it's the last slide and if it is then reload the page.

ChristianP’s picture

Do you think you could give me a little more hint on that one? :)

redndahead’s picture

in advanced

before:function(curr,next,opts){if(!opts.nextSlide){window.location.reload();}}
ChristianP’s picture

Wow! It actually works!! Thank you very much!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.