I have a page where there is a div which is set to 100% width and height and which has a black background. This div covers the main content and after a delay fades, revealing the page content. The problem is that I also have a script which adds stars to the cursor. I wanted this to perform until the black div fades, but it doesn't start until the black div has faded to 80% and then stops when the black div dissapears. Totally out my depth here but wondered if anyone could suggest where I am going wrong. You can view the demo here...
Any pointers would be really appreciated.

Recommended Answers

can you show your code?

Jump to Post

All 2 Replies

can you show your code?


jStars isn't particularly well written. It's not in jQuery's currently preferred plugin pattern and allows nothing more than for the visual effect to be attached to an element. However, its lack of the means to remove it should not be an obstacle in this case because, as I understand it, the effect you want is one-off per page load.

The code will be something like this:

$(function() {
    var $cover = $('#cover');
	var t_fade = 5000;
	var easing = 'linear';
		$cover.fadeTo(t_fade*0.2, 0.8, easing, function(){
				image_path: 'images',
				frequency: 19
			}).fadeTo(t_fade*0.8, 0, easing);
	}, 5000);


The big unknown is whether or not the transition from pahese 1 to phase 2 will be seamless. As you see, I have specifiied 'linear' easing to make the transition as smooth as possible; otherwise the fadeout would go through a flat-spot at the transition point.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.