On this site http://www.flatness.eu/test.html I have a link to a php file.
That file contains an art piece which is written in php.
The page contains layers of images which the user clicks to remove one by one until the page is empty.
Is it possible to make the last click on the php file link the user straight back to the html home page they started from?
The php file you link to is using jQuery to add a class called houdini
to images that are hidden. You can change the click handler to count the amount of images left where the class isn't houdini, and then redirect the user.
$(function() { //run when the DOM is ready
$(".image").click(function() { //use a class, since your ID gets mangled
$(this).addClass("houdini"); //add the class to the clicked element
if( $('.image:not(.houdini)').length == 1 )
{
// this is the last image, redirect user
window.location = 'http://yourpageurl.com';
}
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With