I found this code to Show/Hide a DIV. The great thing about it is that will hide the div by clicking anywhere outside the div, which this does.
However, how can I edit this to allow for multiple DIVs?
If you can't help with this particular code, Do you have another code solution I can use for individually showing many divs and then hiding them by clicking outside the div.
I have a page that submits to a db then re-loads its self with new information. Unfortunately it goes wrong when the user double clicks on a one of many text links that provides the info for the display on reload. How do I stop users from double clicking on the page? Ideally I think I would like to call some sort of js function from body onload as I presume this would then cover the whole of the page, but have no idea if this is possible or how to go about writing it.
so I have a button that makes a table appear absolutely(dynamically), and I was wondering how would I go about making it disappear once I made it appear.
i am trying to make a popup div which will close down after the user clicked outside of it now i am looking for a way to determine if the user clicked outside of the div or not
I got a table with hundreds of rows...and I want the user to be able to hide a single one by clicking on the table row.
How can I do this without typing in hundreds of ids like 1,2,3,4,5... Since you can't get elements by class and ids have to unique I'm not sure how to do this. Also the order of the rows will change when they get updated so it would end up being a mess of unordered ids.
If you check the cancer box a div will appear. If you check lung, another menu pops up. If you check colon nothing appears because it's behind the lung div. I am aware of z-index. But because a person may go back and forth between menus I need a way to make sure the appropriate div is always on top.
i am having some problem showing and hiding some divi want to show the div with the id="universitiesDiv" on one point and the div id="highSchoolsDiv" on another depending on the user choice of selected option.
function Show (titleImg){ // the id of the content element from the id of the title element var contentID = titleImg.id.replace (/title/, "content");
Does anyone know the javascript to be able to have a table row collapse when there is no text in one cell, but there is text in the next cell? I have a 2-column table with titles in the left column and want the right column to be populated by a user. If the user doesn't populate the right cells or row, I'd like that row -including the constant/visible text that is in the left col- to be hidden and that row to collapse or move up... possible?
I am trying to write a script that will hide a table in NS4. getElementById only works with IE4+ +NS 7 anyone go any idea how to adapt to function below to support NS4?
function hide(st) { document.getElementById("hide").style.display=st;
is someone know a good way to show/hide a div in explorer as style.display do not work at all for me. I also try with visibility but then, it doesn't work in Firefox as I still see the scrollbar.
i am having some problem showing and hiding some div.i want to show the div with the id="universitiesDiv" on one point and the div id="highSchoolsDiv" on another depending on the user choice of selected option.
I was wondering if anyone wanted to take a shot at re-factoring my code. I am not a javascript guru, and I would like some feedback on what I could do to make it better.The code shows/hides the top div, and when the top div is hidden, the bottom div takes up the space of the top div.
I have some javascript that when a link is clicked hides the div and when it is clicked again shows the div... what I want to do is reverse that, so it is intially hidden. I have tried changing the display none to different parts but it always shows on load:
function toggleDiv (divid) { if (document.getElementById (divid).style.display == 'none') { document.getElementById (divid).style.display = 'block';[code].....
I've got 3 'alternative' boxes, only one of which I want displayed, according to the value of an earlier select (so I'm using the <htmlelement>.style property from javascript).
One is a div containing text, which I amend as appropriate with innerhtml One is an image. One is a div containing 4 input text boxes, which are disabled or not as appropriate.
I've tried .style.visibility = "hidden" / "visible" (correctly leaves blank space, which I don't want) I've tried .style.display = "none" / "block" (works for moz, ie treats as visibility) I've tried setting .style.height & width to "0px" / null (doesn't work for ie).
Any suggestions as to how to make the thing disappear and occupy no space (dynamically) in ie as well as other browsers please ?
If anyone really needs to see the page, go to ccaweddingsdirect.co.uk/basket login with chris at ccagroup co uk (you'll need to accept a cookie) - the password is set to testz (it doesn't confer any great privilege, just accesses my test shopping basket). then click 'enter personalisation' for 4D01 (christmas card) Select different wordings to change the bottom section - 10 and 'your own wording' are the intereesting two, and orderpg.js is the js file.
I'm getting an error in displayDirectors() on the line shown. What I want to do is hide the rows in the table where rs_Board("DirStatus") = "Retired" with hideDirectors() and show all records with showDirectors(). What I did was create a column with a checkbox which is not visible to the user and check this box when rs_Board("DirStatus") = "Retired" and leave it unchecked when it doesn't. There's probably a better way of doing this. I also want the text in <span id="DirectorsCaption"> to change with each function but I'm pretty sure this will work when the other error is debugged. Code:
I have a webpage where on the left side have a menu and on clicking the different rows in the menu, different content needs to show up on the right side. This all has to in a single web page. I suppose this can be done using name anchors but would like to hide the rest of the content and only show what is relevant depending on the row clicked.
Toggling divs is a popular subject and I have found plenty of information and was able to make it work. There is only 1 thing I am still stuck with for quite some time.
I have a dropdown menu and when I select a date from this menu it displays another select box with times for that day. When I select another date another dropdown is shown with times. The problem is now that my page shows two dropdown menus with times.
The dropdown with dates has several dates, so the dropdowns with times that show increases all the time. The question is how do I hide 1 time dropdown div as I select another one? Code:
I'm trying to do a show/hide of several elements on a page and can't get it working in Netscape 4.x. All other Windows browsers are working.
My elements all have the same class name. <div class="myClassName">stuff</div> I cannot use ID because I don't know how many will appear as they are dynamic recordsets. Netscape seems to work OK with IDs but not CSS classes.
For Netscape 4.x I have coded in my javascript: document.myClassName.visibility = "hide"; to hide it and document.myClassName.visibility = "show"; to show it.
When I use the toggle I get this error: document.myClassName has no properties.
Any suggestions? Right now we are considering having standards-aware browsers use client-side show/hide ( via document.getElementsByTagName() ) and forcing Netscape 4.x to reload the page, but would prefer to do it all in the browser.
I am trying to display content when mouseenter the div tag with id="test" when mouseleave i want to hide the contents.It was working fine only once. I want it to repeat that when ever mouseenter or mouseleave.Test1.txt contains - just text