/    Sign up×
Community /Pin to ProfileBookmark

having divs hide before load?

ok so i’m working on a menu system at the top of the page, i’m not using iframes as i feel it really over complicates things. i want the menu to hide right away without the user seeing it disappear. here’s an example of what i’m discussing:

[url]http://www.wowsentinels.com/v2/[/url]

[CODE]function remove(el_id){
var temp=document.getElementById(el_id).style;
temp.display=(temp.display==’none’)?’block’:’none’;
}
[/CODE]

i’m using that to remove the divs.
any help would be greatly appreciated.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@kameelyanauthorJul 30.2005 — got it! and it was simple too ?. sorry, i know more about php than i do about html/javascript in terms of everything you can do.

just gotta do:

<i>
</i>&lt;div id="name" style="display:none"&gt;


would have came across this sooner had i realized the function above contains an (if) ? (then) : (else) syntax
×

Success!

Help @kameelyan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...