Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-30-2013, 07:51 PM   PM User | #16
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,765
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
Thumbs up

Quote:
Originally Posted by voodazzed View Post
Very cool. The IDS parameter makes sense to me because it is encompassing two different ids.

I guess I was confused to why 'info' wasn't used in the button function instead of 'this', but 'this' actually refers to the button element itself, which is then represented in the actual function as 'info' and that is how javascript knows which element to make the changes to in regards to the 'info' placeholder.

Am I correct in my deduction or at least close?
Yep. You said what I was trying to say.
jmrker is offline   Reply With Quote
Old 01-31-2013, 07:25 PM   PM User | #17
voodazzed
New Coder

 
Join Date: Jan 2013
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
voodazzed is an unknown quantity at this point
Okay that's good to know that I'm have at least a loose grasp of what's going on.

The one other thing I can't quite figure out is how you were able to first div content to show up by default.

I thought the loop for the divs hides the divs as long as the variable 'i' is less than the 'sel' variable's length so how is the first div content visible by default?

Thanks a lot for indulging me in this by the way.
voodazzed is offline   Reply With Quote
Old 01-31-2013, 10:13 PM   PM User | #18
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,765
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
I used the same class for the <div> tags, but I added an inline display='block' for the first display.
The inline setting overrides the class setting
jmrker is offline   Reply With Quote
Users who have thanked jmrker for this post:
voodazzed (02-01-2013)
Old 02-01-2013, 03:29 PM   PM User | #19
voodazzed
New Coder

 
Join Date: Jan 2013
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
voodazzed is an unknown quantity at this point
Oh I see! Durrr! I totally missed that part! I was so busy dissecting the javascript, I didn't think to look at the styles!

Okay I believe that answers my last lingering question about this! Thanks again!
voodazzed is offline   Reply With Quote
Old 02-01-2013, 05:20 PM   PM User | #20
jmrker
Senior Coder

 
jmrker's Avatar
 
Join Date: Aug 2006
Location: FL
Posts: 2,765
Thanks: 29
Thanked 453 Times in 447 Posts
jmrker will become famous soon enough
You're most welcome.
Happy to help.
Good Luck!
jmrker is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 02:52 AM.


Advertisement
Log in to turn off these ads.