Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 16th Dec 2012, 12:23 AM   #1
HyperActive Warrior
 
Join Date: 2012
Posts: 119
Thanks: 18
Thanked 1 Time in 1 Post
Default
Need Javascript showing two hidden css divs
Share on: 
fb share twitter share gplus share more share

<body>
<center>
<div id="header"></div>
<div id="wrapper">
<div id="content">
<div id="contenth">
<h1 id=>content header</h1>
</div>
content
<a href="#" onclick="changeDiv(1)">Menu 1</a> ///change to other div
<a href="#" onclick="changeDiv(2)">Menu 2</a>
<script>
function changeDiv(i){
if(i==1)
document.getElementById("content").innerHTML = document.getElementById("step2").innerHTML;
else
document.getElementById("step2").innerHTML = document.getElementById("content").innerHTML;
}
</script>
</div>
</div>
<div id="step2"> // Showed on click
<div id="step2h">//want to show this as well
<h1>STEP 2 Header</h1>
</div>
<h2>Step 2 Content</h2>

</div>
</center>
</body>


This is my current script but I want to show not only step but step2h as well in one click.
Christopherson is offline  
Unread 16th Dec 2012, 12:42 AM   #2
Social Apps Made Easy
War Room Member
 
FirstSocialApps's Avatar
 
Join Date: 2012
Location: Mooresville, NC
Posts: 913
Thanks: 231
Thanked 259 Times in 213 Posts
Default
Re: Need Javascript showing two hidden css divs
Share on: 
fb share twitter share gplus share more share

Using JQUERY:

$('#content').append($('#step2h').html());

FirstSocialApps is offline  
Unread 16th Dec 2012, 12:52 AM   #3
HyperActive Warrior
 
Join Date: 2012
Posts: 119
Thanks: 18
Thanked 1 Time in 1 Post
Default
Re: Need Javascript showing two hidden css divs
Share on: 
fb share twitter share gplus share more share

i dont know how to use jquery =/
Christopherson is offline  
Unread 16th Dec 2012, 09:40 AM   #4
Social Apps Made Easy
War Room Member
 
FirstSocialApps's Avatar
 
Join Date: 2012
Location: Mooresville, NC
Posts: 913
Thanks: 231
Thanked 259 Times in 213 Posts
Default
Re: Need Javascript showing two hidden css divs
Share on: 
fb share twitter share gplus share more share

Originally Posted by Christopherson View Post

i dont know how to use jquery =/
I very strongly suggest you learn. JQUERY is going to make your Javascript tasks so much more easy.

jQuery: The Write Less, Do More, JavaScript Library

FirstSocialApps is offline  
Closed Thread


Bookmarks

Tags
css, divs, hidden, javascript, showing


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 01:43 PM.