Dynadot Black Friday and Cyber Monday 2026: save more on domains. See our sales.

CSS Issue

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

snike

Established Member
Impact
3
I have this script that is supposed to fade content in a div element in and out.

content > fades away to blank > new content fades in

This is the basic setup:

Code:
function displayMenu(currentMenu) {
setTimeout("fadeOut()",0);
setTimeout("fadStay()",1000);
setTimeout('ps_change(currentMenu)',1100);
setTimeout("fadeIn()",1200);
};

The problem I am having has to deal with line 4 of the code. I can't get the ps_change() to run. ps_change changes the content in the div. The content fades away and the content reappears unchanged. Any help is appreciated.

This is ps_change():
Code:
function ps_change (cMenu) {
var thisMenu = document.getElementById(cMenu).innerHTML;
document.getElementById('ps_area').innerHTML = thisMenu;
}

Thanks!
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
The vars need to be outside of the string, try this.

Code:
function displayMenu(currentMenu) {
setTimeout("fadeOut()",0);
setTimeout("fadStay()",1000);
setTimeout("ps_change(" + currentMenu + ")",1100);
setTimeout("fadeIn()",1200);
};
 
1
Close
It works! Thank you!
 
0
Close
Glad to hear :)
 
0
Close
The script really works.Thanks
 
0
Close
Trying to get CSS-based websites to look the same across all browsers can often be difficult. Many of the problems however lie with Internet Explorer implementing CSS commands differently to other, more standards compliant browsers.
____________
SEO
Search Engine Optimization
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back