473,327 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

HIDE/SHOW Layer HELP!

Can somebody please help me with this?

I need some code (html, css, javascript, etc.) that does the exact
same thing as the "more" link on the top of google's homepage.

I need a link that shows hidden content on click and hides the hidden
content when the link is clicked again, or when any other part of the
page is clicked.

This would help so much!

Thanks in advance.
Dec 1 '07 #1
6 1170
si********@gmail.com wrote:
Can somebody please help me with this?
Yes.
I need some code (html, css, javascript, etc.) that does the exact
same thing as the "more" link on the top of google's homepage.
It might be a good idea to have a look at this exact source code, then.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Dec 1 '07 #2
I have looked at the source code and I have a dilemma. The javascript
is written in a long string of code. I do believe that it is illegal
to actually cut and paste the code into my site, so I need it to be
rewritten, right? Since I am not javascript savvy, I dont know how to
do any of this. Do you have any suggestions on what I should do?

Thanks
Dec 1 '07 #3
Randy Webb wrote:
Are you sure the UA supports .getElementById, .style, and .visibility? :)
Unless the user is using a 1995 Browser then yes ;-)
I won't comment on the semi-colons as I don't want to have the debate
again. They aren't required, and can even cause harm if you don't know
for sure where to put them.
Same applies to spaces, commas, parentheses and quotes. Why are
semi-colons different? If you don't put them on, then you can forget
about your code ever being minimized. I used to always drop trailing
semi-colons until the day came when I wanted to minimize some code.
Dec 2 '07 #4
Stevo said the following on 12/2/2007 2:00 PM:
Randy Webb wrote:
>Are you sure the UA supports .getElementById, .style, and .visibility? :)

Unless the user is using a 1995 Browser then yes ;-)
I was kidding, but, you should read back on some threads about my cell
phone browser. Screw ball browser to say the least. I did like your
improvement over the code I posted though.
>I won't comment on the semi-colons as I don't want to have the debate
again. They aren't required, and can even cause harm if you don't know
for sure where to put them.

Same applies to spaces, commas, parentheses and quotes.
Examples of what you are referring to with spaces, commas, parentheses
and quotes?
Why are semi-colons different?
Typically, the issue with semi-colons is the same issue that JSLint will
throw at you if you don't have statement ending semi-colons which are
optional. If you aren't sure one should be there, leave it out. The
parser is going to double-check you anyway and if it wants/needs one, it
will add it. Whether you put it there or not.

There is an old thread somewhere in the archives where I asked if
anybody could post code where the lack of a semi-colon changed/altered
the code.

<URL:
http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/7bb42992e6b6e5/62200f04774ca73f?lnk=gst&q=statement+semi-colon+randy+webb#>

Maybe you can give a real world example of the semi-colon making a
difference - other than minimization of code.
If you don't put them on, then you can forget about your code
ever being minimized. I used to always drop trailing semi-colons
until the day came when I wanted to minimize some code.
Minimizing code has nothing to do with writing "valid code" though. It
is related to something else - file size. Even then, you are only saving
one byte per line. How much difference that one byte makes depends on
the length of your statements. 1 character off of a 30 character line
isn't a whole lot of savings. Just gzip and go on with it :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 2 '07 #5
I won't comment on the semi-colons as I don't want to have the debate
again. They aren't required, and can even cause harm if you don't know
for sure where to put them.
You're right about the semi-colons. I use them because I think it
looks neater.
Dec 2 '07 #6
On Dec 2, 7:39 pm, Doug Gunnoe <douggun...@gmail.comwrote:
Of course. I'm sorry that was stupid of me. I'll fix it.
No problem. I appreciate the help.

Dec 3 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: benzwt | last post by:
I use the following function to hide a <div> named one. function hideObject() { if (ns4) { document.n1.visibility = "hide"; } else if (ie4) { document.all.style.visibility = "hidden"; }...
10
by: David | last post by:
Hi everyone, Hoping there are some .js/browser experts out there that can help with this weird problem. I have made a swap div routine and applied the events to menu buttons with a closer...
3
by: Ryh | last post by:
I have the following scritpt. It hides div layer when mouse is out of the div layer. Inside DIV I have IFRAME box. Unfortuantely it does not work in Mozilla or IE 5.5. It hides div when cursor is...
3
by: Merlin | last post by:
Hi there, I am trying to create a form with an dynamic field that can be shown or hidden. As I saw for example on google it is possible with JS to show a layer and move the content underneath...
3
by: a1000car | last post by:
I have almost 2 weeks tying to find a solution for this. Please help -How can you SHOW/HIDE an thml-dreamweaver layer from a flash movie button. My html layer name is LAYER1, and my FlashMC...
2
by: stasteamb | last post by:
Can anyone help with this please? This is a copy of my code. <td width="20%"><div id="Layer1"> <p onclick="MM_showHideLayers('Layer2','','show')">Raymond</p> <p...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
1
by: liesther2003 | last post by:
Hi i want to show mutli layer by each click, and when i click next layer the first layer should be still display, until maybe 3rd or 4th or 5th layer all are displayed, and at the end when i click...
2
by: dusk | last post by:
Hi, I have a page with lots of hidden divs which are revealed based on choices made at each 'layer'. So I've used naming convention which represents the order in which each div becomes...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.