Go Back   CodingForums.com > :: Client side development > HTML & CSS

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 02-25-2011, 06:59 AM   PM User | #1
shuban
New to the CF scene

 
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
shuban is an unknown quantity at this point
Question What is this code called?

I would like to know how this person is able to switch between search forms by simply clicking the links "dictionary | site wide". What is this code called? I checked the source code, but it doesn't provide me with much information. Any opinions? Ideas? It's not so much important to know how the search form switches, I think just by knowing the code generally, I will be able to deduce how the form switches.

>> http://www.biology-online.org/dictionary/Main_Page

Thanks

Last edited by shuban; 02-25-2011 at 07:07 AM..
shuban is offline   Reply With Quote
Old 02-25-2011, 09:54 AM   PM User | #2
Stooshie
Regular Coder

 
Stooshie's Avatar
 
Join Date: Mar 2008
Location: Dundee, Scotland
Posts: 376
Thanks: 9
Thanked 39 Times in 39 Posts
Stooshie is on a distinguished road
They are using JavaScript to control the style sheet properties of the elements on the page.
__________________
Regards, Stooshie
O
Stooshie is offline   Reply With Quote
Old 02-25-2011, 05:23 PM   PM User | #3
shuban
New to the CF scene

 
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
shuban is an unknown quantity at this point
Quote:
Originally Posted by Stooshie View Post
They are using JavaScript to control the style sheet properties of the elements on the page.
Oh, do you know the name of the code? So that I can search it up on Google?
shuban is offline   Reply With Quote
Old 02-25-2011, 05:50 PM   PM User | #4
Stooshie
Regular Coder

 
Stooshie's Avatar
 
Join Date: Mar 2008
Location: Dundee, Scotland
Posts: 376
Thanks: 9
Thanked 39 Times in 39 Posts
Stooshie is on a distinguished road
I think they have probably written it themselves. View the source code, then look for a reference to a file called script.js then download that file.
__________________
Regards, Stooshie
O
Stooshie is offline   Reply With Quote
Old 02-25-2011, 06:10 PM   PM User | #5
shuban
New to the CF scene

 
Join Date: Feb 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
shuban is an unknown quantity at this point
Quote:
Originally Posted by Stooshie View Post
I think they have probably written it themselves. View the source code, then look for a reference to a file called script.js then download that file.
Thanks. It's a mediawiki so the scripts are all jumbled up. Probably would give an accurate representation of the code I'm looking for.
shuban is offline   Reply With Quote
Old 02-26-2011, 01:43 AM   PM User | #6
quartzy
Regular Coder

 
Join Date: May 2009
Posts: 813
Thanks: 123
Thanked 24 Times in 24 Posts
quartzy is an unknown quantity at this point
It may be copyrighted so I would not download it.
quartzy is offline   Reply With Quote
Old 02-26-2011, 01:49 AM   PM User | #7
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by quartzy View Post
It may be copyrighted so I would not download it.
is free but have a creative commone licence:

Quote:
To grow the commons of free knowledge and free culture, all users contributing to Wikimedia projects are required to grant broad permissions to the general public to re-distribute and re-use their contributions freely, as long as the use is attributed and the same freedom to re-use and re-distribute applies to any derivative works. Therefore, for any text you hold the copyright to, by submitting it, you agree to license it under the Creative Commons Attribution/Share-Alike License 3.0 (Unported). For compatibility reasons, you are also required to license it under the GNU Free Documentation License (unversioned, with no invariant sections, front-cover texts, or back-cover texts). Re-users can choose the license(s) they wish to comply with. Please note that these licenses do allow commercial uses of your contributions, as long as such uses are compliant with the terms.
http://wikimediafoundation.org/wiki/Terms_of_Use

http://www.mediawiki.org/wiki/MediaWiki

best regards
oesxyl is offline   Reply With Quote
Old 02-26-2011, 02:00 AM   PM User | #8
quartzy
Regular Coder

 
Join Date: May 2009
Posts: 813
Thanks: 123
Thanked 24 Times in 24 Posts
quartzy is an unknown quantity at this point
HI Oxes
Good you found out that it was free, to me it sounded like the other person was telling the enquirer to download a script that a coder may have written themselves, ie copyrighted perhaps.
quartzy is offline   Reply With Quote
Old 02-28-2011, 10:30 AM   PM User | #9
Stooshie
Regular Coder

 
Stooshie's Avatar
 
Join Date: Mar 2008
Location: Dundee, Scotland
Posts: 376
Thanks: 9
Thanked 39 Times in 39 Posts
Stooshie is on a distinguished road
Clicking on dictionary/site wide calls a function called switch_menu() which is about 10 lines of code (looks like a self-written script, with no copyright info) which sets display style on the search boxes to display the correct one.

Googling getElementById will give you the code you need to change the display.

Their google(sitewide) searchbox is the standard google search box that any site admin can get from google. Their own search box will be a custom search written into the wiki.

In summary

Changing the layer to display (switch_menu) is a very easy function to write (so easy that using it would be very unlikely to cause a problem). The div containing the google search is easy to obtain from google and their own custom search will be part of their wiki.
__________________
Regards, Stooshie
O
Stooshie 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 09:54 AM.


Advertisement
Log in to turn off these ads.