Jump to content

Page Refresh and Innerfade


Manny

Recommended Posts

The query I have relates to the content on the following page:http://www.burndenaces.co.uk/rumourmillBasically, I want the page to refresh automatically every few minutes and the images on the right to scroll through. For the purposes of simply seeing if it works or not, the page is currently set to refresh every 15 seconds.I can get both functions working individually, but I need both to run and this is where I'm bumping into problems.The code is below. What am I doing wrong that is preventing the script from running as it should?

function getFresh() {	$("#rumourmill").fadeOut(400, function() {		$("#rumourmill").load("rumourmill.php", function() {			$("#rumourmill").fadeIn();		});	});};function getinnerFade() {	$('.fader').innerfade({		animationtype: 'fade',		speed: 3000,		timeout: 8000,		type: 'sequence',		containerheight: '294px'	});};	$(function(){	getFresh();	var int = setInterval("getFresh()", 15000);		getinnerFade();});

Link to comment
Share on other sites

The page refresh is working fine. There are some images on the right of the page (link provided) that scroll through using the innerfade function. It is this that isn't working. Whether I've got syntax wrong, I don't know.

Link to comment
Share on other sites

If you have firefox (and if you don't you should get it) you should download firebug plugin. It will tell you (as it told me) that there is something wrong with line 10 of jquery.innerfade.settings.js; specifically a syntax error.

Link to comment
Share on other sites

I'm using Firefox and Firebug, though hadn't checked Firebug for the syntax.I've taken the refresh code out to check if the innerfade is still working, and it is. I also tried it the other way round, taking the innerfade out and only running the refresh code, and that worked too. Why it won't run both I don't know.Below is the innerfade code that works fine.

$(document).ready(	function(){		$('.fader').innerfade({			animationtype: 'fade',			speed: 3000,			timeout: 8000,			type: 'sequence',			containerheight: '294px'		});	});

Link to comment
Share on other sites

Try adding a return; statement at the end of your functions.
Like this?
function getFresh() { $("#rumourmill").fadeOut(400, function() { $("#rumourmill").load("rumourmill.php", function() { $("#rumourmill").fadeIn(); }); }); return;};function getinnerFade() { $('.fader').innerfade({ animationtype: 'fade', speed: 3000, timeout: 8000, type: 'sequence', containerheight: '294px' }); return;}; $(function(){ getFresh(); var int = setInterval("getFresh()", 15000); getinnerFade();});
Link to comment
Share on other sites

Yes. I can't be sure it will solve the problem. But I seem to remember that I had a problem a few years ago because of it, so it's worth a try.

Link to comment
Share on other sites

are you getting any errors? If your link has the latest code updated, then it looks like getFresh() is not defined.

Link to comment
Share on other sites

are you getting any errors? If your link has the latest code updated, then it looks like getFresh() is not defined.
This is the code I have at the moment:
function getFresh() {	$("#rumourmill").load("rumourmill.php");	return;}function getinnerFade() {	$('.fader').innerfade({		animationtype: 'fade',		speed: 3000,		timeout: 8000,		type: 'sequence',		containerheight: '294px'	});	return;};	$(function(){	getFresh();	var int = setInterval("getFresh()", 15000);});

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...