JQuery :: Toggle To Open One Div And Close All Other Open Divs?
Mar 22, 2010
I have multiple parent sections on the page. Each section has 3 child sections. Each parent toggles open and closed. and within each section there are buttons to toggle the children open and closed.
In the case of both the parents and their children, when a parent is toggled open I want the other parents to toggle closed . The same applies to the children of each parent. I want to close all the other open children when a child is toggled open. Rather like some accordions - which I can not use for this function. This way there is only one parent and one child open at any time
Because of the number of parents and children on the page I can not use Ids. All are designated by classes
View 5 Replies
ADVERTISEMENT
Jun 26, 2010
Trying to learn the basics... Here is a script for three toggle buttons that each when clicked open their corresponding divs. Fine. Now how does one go about automatically closing an open div when clicking on a new 'toggler' that opens it's div? I see other posts about this very question, but I'm just not grasping the logic.
jQuery(document).ready(function($) {
$("#toggle1").click(function () {
$("#toggle1div").toggle("drop", {direction:"right"}, 500);
});
$("#toggle2").click(function () {
View 3 Replies
View Related
Jun 14, 2010
I have some code that I adapted from [URL]. I am trying to figure out how I can create a link to close all open divs or open all divs? My current code: [URL] .
View 8 Replies
View Related
Sep 14, 2010
I know very little of Javascript and I'm trying to edit some to make it work the way I need it to. What I have is a simple script that toggles open and close of a table row. It works fine except for one thing; It starts out open. I need it to start closed. I tried changing some of the code and even switching function names to see if I could get it to work. But all I ever get with my changes is it just staying stuck open.
[Code]...
View 2 Replies
View Related
Oct 17, 2010
Clicking on the menu buttons, a box with some info opens, ad under that, a div that makes the body of the site black. the problem is when i click a different button, to open a different box, the "div#black" should stay open and not toggle. i tried this
var black = $("div#black").toggle() ;
if (black == false { $("div#black).fadeIn("slow"); };
and this was the javascript for the button (with the toggle function, when i didn't use the if/else):
[Code]....
I don't know which is the correct way to write the if statement, i used easier ones but this one is to complex for me :D i think the main problem is the "var"
View 4 Replies
View Related
Oct 22, 2009
I need three tabs out of which only one is open at a time n when u open another tab, one out of the earlier closed one should open(preferably with mootools). And also the tab which is opened should come at the top of the page as well.
View 1 Replies
View Related
Feb 26, 2010
I'm looking for the script for closing a div and at the same time open another,
View 1 Replies
View Related
Nov 3, 2011
My mission: Open/collapse TD cells based on items selected in a list box. Getting no response from jQuery so I've done something wrong but cant quite get there. Listbox 'mainselect' contains option values that refer to names of TDs in a table. When a mainselect option is clicked, it will toggle to open or close the referenced TD list box by option value. Does hide/show make a TD 'blank' or actually set it's width to '0'? I want it to close, moving other cells left.
<html><head>
<script src="jquery-1.6.4.js"></script>
<script>
$(document).ready(function() {
[Code]....
View 2 Replies
View Related
May 17, 2006
Trying to make a script function that opens a new window with a new
location, and then closes the old window. My function looks like this:
<script language="javascript">
function deletecook()
{
new_win = window.open('http://www.blahblahblah.com/')
window.close()
}
</script>
But it doesn't close any windows, not even the one it just opened. Any
takers?
View 7 Replies
View Related
Jul 20, 2005
I installed a script which opened a window in a predefined format.
It works fine!
I want to know if it is possible to close that screen with java.
(however, the code should be in the childpage)
View 1 Replies
View Related
Oct 7, 2010
My code works but when I put an image in there my code doesn't work anymore.
Code:
<html>
<head>
<style type="text/css">
.planType{display:none; width:600px}
[code]....
View 2 Replies
View Related
Oct 9, 2009
Can I get javascript to open a window and close it, without a user seeing it? Basically, I want to open a site, so it downloads and sets a cookie before I display a link for a user to click on.
View 2 Replies
View Related
Oct 7, 2010
My code works but when I put an image in there my code doesn't work anymore.
Code:
<html>
<head>
<style type="text/css">
.planType{display:none; width:600px}
[Code]...
View 1 Replies
View Related
Jun 29, 2005
I want to open a new window on when a page load , and want to close the first one I am using a function F() at <body onLoad="F()">
<script language="javascript">
function F()
{
window.open('asasas','','scrollbars=yes,width=600,height=400');
window.close();
}
</script>
This is working as I want but I am getting an popup that your window is going to close by a program can we remove that, I am using IE6.0
View 2 Replies
View Related
Sep 2, 2006
I'm running a bat file that runs a php script, that backs up my db.
Problem is that I'm limited by the functions I can use as I'm on a winXP box and dont want to compromise security.
The function I'm left with means I should run the script from a browser as it echoes out the results. At this point I'm not opening a browser so it is creating a few problems.
To get around this I thought I might be able to use js. But, I've been testing with a script I hacked (and I mean hacked, its probably a mess).
4 problems:
1. its trying to download a file
2. still has a pop-up asking if its ok to close window
3. its not displaying the php file
4. even if I click the 'go back' link it still asks if it should close.
I will enclose the php script I'm running from bat file in the hopes some-one will kindly put it all together for me For testing I've just been running (trying to include, not download, as I'm getting now) a small php script that says 'hello world' Code:
View 1 Replies
View Related
Jan 6, 2010
how can i accomplish this
View 12 Replies
View Related
Oct 7, 2010
My code works but when I put an image in there my code doesn't work anymore.
<html>
<head>
<style type="text/css">
[code]......
View 3 Replies
View Related
Jul 17, 2009
I have used below javascript function in body tag unload event...
<body onunload="openpopup();">
</body>
function openpopup()
[code]......
View 7 Replies
View Related
Jul 23, 2005
client wants for a window with no toolbars to open (technical and 'esthetical' reasons) after the window, user clicks on, is being closed.
I told them about security settings in browsers and no cross-browsers solutions and all of that we know, but they have told me they have seen that before and how then the annoying pop-up windows work? . . .
View 21 Replies
View Related
Aug 13, 2005
How do you open a new window and closed the parent window. ie click on link and new window opens in place of original window.
Is there some way of combing window.open and window.close?
View 1 Replies
View Related
Jul 4, 2010
I have a list like this
Code:
<ul id="main_menu">
<li><a href="#">Comments</a></li>
<li><a href="#">Advertising</a>[code].....
What i needed is when i press a list containing the submenus . Close all open lists Then open this menu
View 4 Replies
View Related
Sep 6, 2007
What I am trying to figure out but having difficulty with is opening and closing a Lightbox from JavaScript. For example, if I use this html...
<a href="#testLB" rel="testLB" class="lbOn">Test Lightbox</a>
It will display a div since I coded this div in the HTML file...
<div id="testLB" class="leightbox">
<h1>Test</h1>
<a href="javascript: test();">Change Zip</a>
</div>
What I want to be able to do is to display this div with Lightbox but do it from JavaScript. For example, from the body onLoad event I would like to call a JavaScript function that opens a Lightbox.
Then, the Lightbox is going to contain a few fields so I was going to have JavaScript validate that the user entered all the fields. If they did, I then want to close the Lightbox. If they did not, I will display an alert message. I can get all of this to work except having JavaScript close (actually, it is hiding) a Lightbox div. Can someone help me figure out how to hide the div from a JavaScript function?
What I downloaded was Lightbox Gone Wild which I think is also called Leightbox.
View 1 Replies
View Related
Feb 1, 2010
This is my first post in this forum, sorry if im doring anything wrong. I want to add a javascript panel to my site... I have all the js and CSS code, and this works fine. But isnt it possible to do so when you press "Menu 1" then the panel opens+it links to a nother page... something like this <a href="index.php">Menu 1</a> ??
I have tried to code it myself for a few days now... And searched the net for ages, but cant find anything.
<ul id="menu">
<li>Menu 1
<ol>
<li><a href="#">Sub Item 1.1</a></li>
<li><a href="#">Sub Item 1.2</a></li>
[Code]...
View 1 Replies
View Related
Jul 4, 2010
I have a list like this
<ul id="main_menu">
<li><a href="#">Comments</a></li>
<li><a href="#">Advertising</a>
[code]......
View 2 Replies
View Related
Mar 2, 2010
I'm working on a website where I need some help with open and closing divs using javascript.
This is the website: [url]
As you can see I'm using a javascript to open each jeans style link, I don't know if this is the best way to do it, but it's how I've done it so far. If you click the "Frankie style link" at the bottom the div called Frankie will show and you will see a little image in that div that says "next wash". What I would like this link to do is to close the frankie div and open up another wich looks almost the same as the previous, the only thing that will change is the pictures actually.
View 3 Replies
View Related
Oct 31, 2011
How to make an image map link to another page AND open a specific accordion section?I guess I need a script that knows which area of the image map was clicked and not only navigate to page 2 but opens the section via slide toggle I need it too.Here is the the page with the image map (although image map version not upload yet so I have what will be uploaded below)[URL] ...and the page I need to navigate to based on the area of the image map clicked and also slidetoggling the div I need it [URL] Here is the image map:
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<img src="/Img/Illustrations/kicktalkv2.jpg"" alt="Kick Talk" usemap="#kicktalk_map" />
[code]....
View 2 Replies
View Related