I need a script to expand and collapse items so only one sublist is visible
at a time. I've found several scripts for trees but they either need the
list to be in their own format or they add tons of weird code to insert
icons and style the list (which breaks my design). Could you recommend me a
simple script to do so?
I have been trying to make an expand/collapse (essentially accordion) list. So far, everything works and looks fine in Firefox, Safari, and Chrome, but in IE8, the page height is static when it loads, with a page height being as if all headers in the list were expanded. The expand/collapse functionality works,but as you can imagine, there is this big gap of space after the list.
The html markup uses <h2> tags for the always-visible header portion and a <div> for the expanding/collapsing content. The <div> content contains form elements and everything is enclosed in a form tag.Anyways, here is the jQuery code:
I've made a animated collapsable list using this script. But now I want to keep one submenu expanded, I have the ID of the ul that must be kept expanded. So after everything is collapsed my script checks the ID of every submenu and compares it to the given ID. If the ID of the submenu is equal to the given ID, the submenu should expand. Should, because that doesn't. Here's the code:
[Code]...
I've never used jQuery before, I tried this, but it doesn't work. Also, I don't want to toggle the children, but just show them; without an animation.
im using this toggle for a project, i have use it once, and it works well with IE, but then again, for mozilla, its not being displayed correctly after the first toggle, Code:
I am wondering how I would make the [-] Button that collapses/expands a thread here on the forums. (I hope you know what I mean, its tough to explain)
I am going to have a page with multiple entries using XML and would like to be able to have the title of an entry showing and then you can press on the expand button to view further details.
I have a bit of code that works perfectly for me that expands/collapses a div without any animation from top to bottom. I'm looking for the same exact code that lets me expand/collapse from left to right. I've done my due diligence and have search many forums with limited luck (I've only found one that is animated that I can't turn off the animation). Can someone point me in the right direction to code that does exactly the same as what I've posted below except from left to right?[code]
I have a php function that returns a list of people with their attributes ie address, telephone, email, etc. my idea is to display the full name of person, and then when I click on a link "more data" open a window down to display the other data, email, phone, etc.., for this use a jQuery script that collapses / expands a div, taken from: [URL], the script works fine, but only runs on the first element (person) that appears in the list in the other script is not running, if I have several pages of results, always work the first item on the list. this is the javascript code of the page, obviously this liibreria declared jquery:)
I have a drop down menu who shows a list of page. Some links have subcategories. When I click to it that show the subcategory list. But what I want is when I click on another that close the previous one. Just one should be open. You can have a look at the screenshot:
I'm running into a problem with having a bunch of different selected areas in my editable document in mozilla. I can't seem to get them all unselected. I can get one or two to unselect but not all of them.
This happens after I have been using comparePoint in a loop that loops through the whole document. I have used collapse on the selection I made but it leaves other text still selected. :confused: Is there a quick way to unselect all the selections in mozilla?
My intent is to be able to expand/collapse multiple tables individually, and all at once. My current implementation allows for the "individual", but not the "all at once" functionality, because the current code I'm using just toggles. code:
I'm not very experienced with javascript, but I have a bit of code that works perfectly for me that expands/collapses a div without any animation from top to bottom. I'm looking for the same exact code that lets me expand/collapse from left to right.I've done my due diligence and have search many forums with limited luck (I've only found one that is animated that I can't turn off the animation). Can someone point me in the right direction to code that does exactly the same as what I've posted below except from left to right?[code]
Im just starting to get into javascript, and what I am trying to do is find a script that I can run on page load that will collapse / hide all div tages that have an id that begins with "div_".
Basically I have a page with an infinite amount of div tags each having their own id, ie div_0 , div_1 etc etc ..
on page load i want them all closed, but only these ones . not any other div on the page .. how would I be able to do this ..
I look for something in jquery ( a sliding panel div that can also be collapsed and shows the correct image, hard to explain please see below link, its used on this [code]Anything such exist for jquery with the same features?
BUT, without needing a framework (jquery,mootools,scriptalicious,protoype,dojo,etc). I don't need all the extras that come with the framework and want to keep loading time down to a minimum.
I realize that expanding/collapsing DIV scripts are common but I can't find one suitable for my code. Most of them seem to rely on a unique DIV ID. I have the following XHTML code on my page.
Basically I want my link to expand the .eventbody for the particular .event and there could be an unlimited number of .events. I'm not sure how to go about achieving this. I've already got a script that toggles the display(block or none) for a DIV, but it relies on a specific DIV ID.
I have bit of PHP that creates tables on the fly. I found a bit of javascript that works on static tables, but not very well with 'on the fly' tables. It works to the point where the expand/collapse link works on only the first table on the page. For example, 4 tables will be created when the page compiles. If I try to use the expand collapse thing on table 4, it will only affect the first table.. same with the second and third tables.
Is there a way to make all this code dynamic? Maybe make the ID dynamic or a different way other than document.getElementById? Code:
I want to add a + - for collapse and expand all. I would prefer to have them change accordingly but it isn't necessary.
This is my javascript: var toggleMenu = { init : function(sContainerClass, sHiddenClass) { if (!document.getElementById || !document.createTextNode) {return;} // Check for DOM support var arrMenus = this.getElementsByClassName(document, 'ul', sContainerClass); var arrSubMenus, oSubMenu, oLink; for (var i = 0; i < arrMenus.length; i++) { arrSubMenus = arrMenus[i].getElementsByTagName('ul'); for (var j = 0; j < arrSubMenus.length; j++) { oSubMenu = arrSubMenus[j]; .....
This is my html code: <script type="text/javascript"> function MM_showHideLayers() { //v9.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible'v=='hide')?'hidden':v; } obj.visibility=v; } } </script> .....
I have a javascript to expand and collapse content in 3 ways (all items, one item and nothing).
I have written a javascript myself but the iconcs that are used to switch between modes don't show correctly in IE7, not always then. Here's how it should work:
Default expand one, expand all, expand nothing is loaded from a cookie. If not available, expand all will be executed.
If you click on an icon an event goes which does 3 things: changes the event of the image in the browser (so open_all becomes open_one, this is how I make it switch).adds style="display: none;" to the other element and makes this one visible.saves the new state to a cookie. Code:
I have some server-side code that creates a table from a database query. The basic idea is that there are group leaders and each leader has one or more members. I created the ID dynamically from the query.
When a user clicks the button next to a group leader, the members should hide or show, opposite of current display. Code:
I started some programming with Javascript.I'd like to use it to expand/collapse some headers in a page. I made following code to do this.:collapse-expand.txt.That works perfect!But I want to add something, and I have some problems with that. As I have e.g. 4 headers, I want to expand the text (in <p>-tag) by clicking on header 1. When I click on header 2, I want to collapse text of header 1 and expand header 2 text.And so on.That way, I get the height of the site relatively small without needing to scroll.I don't quite know how to implement this function into my JS-code!And if it could be implemented in my .js file, how do I link that in my html, because now I have in every header the same line:<a href="#first" onClick="shoh('first');">, <a href="#second" onClick="shoh('first');">, etc..How can I get the content of header 1 be seen as soon as the screen pops up. So you don't have to click on Header1 before you can see it? And then go on from there: clicking on header2 makes text of header 1 disappear and expands text from header 2, and so on.