Jump to content

I have a website that is a simple slide show it plays on a tv. I need the slide show to update without refreshing. if there is a new slide show it can but if there is not in the 5 sec period then nothing will happen.

Link to comment
https://linustechtips.com/topic/4100-html/
Share on other sites

Link to post
Share on other sites

With javascript doesn't require refreshing the page check this playlist for more info

Also you could try AJAX which allows for refreshing a section of the page without having to refresh the entire page

Check his

for more information, it's a playlist from The New Boston youtube channel
Link to comment
https://linustechtips.com/topic/4100-html/#findComment-54930
Share on other sites

Link to post
Share on other sites

João Severino you are awesome man and Tim3Shift3r and so are you man thanks now do those auto update without refreshing?

its sort of an internal system that keeps changing the source of the picture, and that lets the picture 'refresh' and not the entire page
Link to comment
https://linustechtips.com/topic/4100-html/#findComment-58582
Share on other sites

Link to post
Share on other sites

Here is something I've done recently. This is just a generic slider/rotator, you can just adjust the CSS to fit its size to your liking.




IMAGE_URL1
IMAGE_URL2
IMAGE_URL3

and your javascript. Be sure to have jQuery also included.


$(window).load(function() {
$('#image-rotator img:not(:first)').hide();
$('#image-rotator img').css('position', 'absolute');
$('#image-rotator img').css('top', '0px');
$('#image-rotator img').css('left', '50%');
$('#image-rotator img').each(function() {
var img = $(this);
$('').attr('src', $(this).attr('src')).load(function() {
img.css('margin-left', -this.width / 2 + 'px');
});
});

var pause = false;

function fadeNext() {
$('#image-rotator img').first().fadeOut().appendTo($('#image-rotator'));
$('#image-rotator img').first().fadeIn();
}


function fadePrev() {
$('#image-rotator img').first().fadeOut();
$('#image-rotator img').last().prependTo($('#image-rotator')).fadeIn();
}

$('#image-rotator, #next').click(function() {
fadeNext();
});

$('#prev').click(function() {
fadePrev();
});

$('#image-rotator, .button').hover(function() {
pause = true;
},function() {
pause = false;
});


function doRotate() {
if(!pause) {
fadeNext();
}
}

var rotate = setInterval(doRotate, 5000);
});

Link to comment
https://linustechtips.com/topic/4100-html/#findComment-59808
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×