JQuery :: Show / Hide Divs Using Toggle?

May 24, 2011

Completely new to jQuery but I am trying to implement a few pieces on my new website. At the moment I have three images in a row and I want to be able to click on any one of the images and use jQuery to populate a hidden div below the three images that contains more info and slide it out using the fold animation. I'd also like it if when a second image was clicked it closed the currently open div and opened the new one. I've seen tutorials that open the divs but can't find one that closes them again on opening a new one.

Can anyone point me to a tutorial that does this or suggest how it could be done?

View 2 Replies


ADVERTISEMENT

JQuery :: Toggle - Hide Show 2 Divs With One Button

Jul 28, 2010

I have 2 divs: <div id="box1></div> and <div id="box2></div> I also have one link to contoll them both. The effect I want to get is: when I click first time on my link box2 hides, when i click second time also box1 hides, when I click third time both divs should show. I manage to do that both divs hiding but later I can't get the show. Im trying sth like this:

$(document).ready(function() {
$('.slick-hide').click(function() {
$('#box2').hide('fast');
$('.slick-hide').click(function() {
$('#box1').hide('fast');
$(".slick-hide").removeClass("slick-hide").addClass("slick-show");
$('.slick-show').click(function() {
[Code]...

View 2 Replies View Related

Show/Hide Toggle On Multiple Divs?

Oct 24, 2010

On the homepage of my site, I would like to have some nav links that toggle between a few divs that are below in the content The divs in the content should display one at a time. For example, if you click nav1, the user would see div1. If nav2 is then clicked, div1 would hide and div2 would display.

I have some code that will do this, but for some reason it is hiding any divs that are within the toggled div. I'm very basic with JS and could use some help here. Here is my code:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
function toggleID(IDS) {
var area = document.getElementById('secondContent');
var sel = area.getElementsByTagName('div');

[Code]...

View 1 Replies View Related

Multiple DIVs Toggle Show/Hide?

Dec 7, 2010

Complete JS first timer here, hope you all can understand my difficulties and stupidities without getting too frustrated. Trying to make a portfolio website as a Christmas gift. Anyway, I'm trying to build a menu that:

1. Expands/Retracts when clicking on other 'headers' in the Menu.
2. Allows for more than one object to be listed in each 'header'.

(Something similar to this [URl]... I've tried to hatch together several online solutions but I really have no idea what I'm doing, as you can see:

[Code]...

View 1 Replies View Related

JQuery :: Toggle Function - Hide/show Table When Hide/show Button Is Pressed

Sep 12, 2011

I am trying to hide/show table when hide/show button is pressed

Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.

Code:

View 1 Replies View Related

JQuery :: Show Two Separate Divs, Hide Divs On One Click?

Aug 19, 2009

I'm looking for some javascript to work with wordpress (jQuery preferrably) that will show/hide multiple divs on one click.

I had one working but it was kinda janky because it was causing me to have two divs with the same ID on one page. No good.

Since I updated to wp2.8.3 prior to launch, it's not working. So I've decided to just try and do it right.

Here's a page: [URL]

So, what I want to happen: On page load, the first tab: "general" and it's corresponding div beneath should be showing. And the first image should be showing. The other content divs and images should be hidden. I've given the text content divs a dashed border to show their borders. When a visitor clicks "dine at home" the general div and image hide, the second content div shows, as does the second image (it's currently the identical image, but the client may change later.) Etc.

I'll be using this function on a few other pages as well.

how to adjust this javascript to work on two different IDs at once?

current code:

Code:
<script type="text/javascript" charset="utf-8">
$(function () {
var tabContainers = $('div.imgswap > div');

[Code]....

View 2 Replies View Related

JQuery :: Cookie In Show/hide Toggle Div

Apr 15, 2011

My script:

Question:How can I insert a cookie to this, so that when I hide it, it will remain hidden after refreshing the page.

View 2 Replies View Related

JQuery :: Toggle For Div Swapping, Or Div Hide And Show?

Jul 29, 2010

I'm trying to do a quick and dirty jQuery toggle swap, I'm swapping the div ok, but I can't seem to work out how to swap back to the original.

[Code]...

View 1 Replies View Related

Jquery :: Show And Hide Divs?

May 24, 2010

I have been using a jquery based plug-in, and what i would like to do is degrade it, so a non js enabled browser will hide the relevant div when js is not enabled, and show a different div with appropriate message content.i have followed a couple of tut's which do this on click, but i would like this to occur on page load.

View 2 Replies View Related

JQuery :: Assign Toggle To Show Or Hide / Using Tinysort?

Aug 10, 2011

I have spent two days trying to figure this out...No Luck.I am creating a dynamic list I would like to assign a value to a button that if the PY =Blue then show only py=blue and the same for py=Green then show only green.My Code:

<!DOCTYPE html>
<html>
<head>

[code]....

View 1 Replies View Related

Jquery: Show Hide Toggle / Make This Work?

Aug 2, 2010

jQuery Code...

Clicking the link toggles the visibility of the Disclaimer, but it does not toggle the text of the a#toggleButton. How can I make this work?

View 3 Replies View Related

JQuery :: Toggle Show/hide Div - Overlapping Content?

Aug 27, 2010

I have the following show/hide div function made with jQuery:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

[Code].....

It toggles perfectly, but I would like to make to which appears to overlap the underlaying content div below. Right now it just pushes down the content div when sliding out.

View 2 Replies View Related

JQuery :: Use A Toggle To Hide And Show Some Content - Isnt Working ?

Jul 6, 2009

I want to use a toggle to hide and show some content but it isnt working

html code:

JS code:

But this code dont works correct, notiv that i want to use more then one box.

View 5 Replies View Related

Jquery :: Show / Hide DIV - Mootools Toggle Stopped Working

Aug 16, 2011

I'm using mootools-core-1.3.2.js & mootools-more-1.3.2.js to toggle hide/show a div
but since I started using jquery-1.4.4.js the mootools toggle stopped working. Here is the jquery code I'm using on all of my pages

Code:
$().ready(function() {
function formatItem(row) {
return row[0] + " (" + row[1] + ")";
}function formatResult(row) {
return row[0].replace(/(<.+?>)/gi, '');
} .....

View 11 Replies View Related

JQuery :: Hide Divs With Float:left And Show Them Again?

Aug 20, 2009

I have a site with a lot of small div-boxes (with images and movieswithin them)they are positioned with CSS and float:left.i created buttons, which show and hide either all images or all moviesthis works well.but when i switch between these options, the float-position of thedivs goes crazy and every div-container is on one line for itself(instead of 5 on one line)

View 2 Replies View Related

JQuery :: Show And Hide Columns Or Divs Using A Timer?

Oct 6, 2010

I have a table with 5 columns, I want to show column by column, first show the 1st column, after 5 seconds hide this column and show the 2nd column, and when I show the 5 column hide this and return to the 1st.All this automatically, without a button click If is more easy with divs I can change this columns for divs

[code]....

View 1 Replies View Related

JQuery :: Show/Hide Divs For Multiple Selects?

Mar 25, 2011

I have a jquery function that will show or hide a div id="hide1" based on the result of a select id="ticket1"

$(document).ready(function(){
$('#hide1').hide();
$('#ticket1').change(function(){
if(this.value == 'adult'){$('#hide1').hide();}

[Code]....

It works well! But my script actually clones elements of the form so a user could be selecting adult or child for a number of tickets - ticket1,ticket2,ticket3....

How can I adapt that script so that it will show/hide for each ticket

View 4 Replies View Related

JQuery :: Show/hide Divs, Shadowbox Compatibility?

Sep 15, 2010

I'm currently programming a website and we wanted to have Jquery on it. This is my first real foray into Jquery (other than occasionally using a plugin here and there) so I'm a bit confused as to why what is happening is happening.

The idea is to have 3 different things going on: At the top of the website we want rotating ads. When one of them is clicked, it opens a video file in Lightbox style (darkens the BG) 3 rotating banners below that, when clicked they just go to a website 3 more buttons with play buttons in the corners. When the play button is clicked, a video player takes over the button and plays the video. So far I have the 2nd and 3rd one working. The video player works, the Jquery shows and hides the divs appropriately, and the rotating banners work great.

[Code]...

View 4 Replies View Related

JQuery :: Show / Hide Multiple DIVs On Page?

Jul 11, 2011

I have a little issue with trying to hide / show multiple divs on my page. I am using a class name for the divs but the name is generated by a field have set in my database. So for example
<div class="General">Ttitle 1</div>
<div class="General">Ttitle 2</div>
<div class="General">Ttitle 3</div>
<!-- and my link is -->
<a href="#" class="toggle" title="General">Toggle 1</a>

And then say I have
<div class="Questions">Ttitle 1</div>
<div class="
Questions ">Ttitle 2</div>
<div class="
Questions ">Ttitle 3</div>
<!-- and my link is --><a href="#" class="toggle" title="
Questions ">Toggle 2</a>

What would be the easiest way or the best way to code out the jquery to hide / show all the divs with the same name as the links title i can do code jquery to toggle 1 div but not sure how to code it so that it will hide / show all the divs with the same class name.

View 5 Replies View Related

JQuery :: Show/hide Multiple Divs Independently?

Mar 28, 2010

Is there a way I can simplify my code below? I want to be able to have just one iteration of the code and have it automatically switch out the IDs without have to add a new bit of JavaScript with each new div that is added. Here's my Javascript:

$(document).ready(function() {
// toggles the personnel window on clicking the image/header
$('div.title'+'#one').click(function() {

[code]....

View 2 Replies View Related

JQuery :: Show Hide Multiple Divs Independently Without #ID?

Dec 5, 2009

I am new to jquery and need some help with this I have the following simplified html

[Code]...

View 2 Replies View Related

JQuery :: Add 'slow' As The Duration The Button Doesnt Seem To Toggle Between Hide And Show?

Jan 6, 2011

I have a paragraph that I have set to disappear on the click of the Hide button, I have also set the button to toggle between Hide and Show depending on whether or not the content is visible. My problem is, when I add 'slow' as the duration the button doesnt seem to toggle between hide and show?

Code:
<p id="disclaimer">

Disclaimer! This service is not intended for the those with criminal intent. Celebrities are kind of like people so their privacy should be respected.

</p>
Code JavaScript:
$(document).ready(function() {
$('<input type="button" class="toggle" name="toggle" value="Hide" />').insertAfter('#disclaimer');[code].....

View 4 Replies View Related

JQuery :: Hide / Show Multiple Divs From Anchor Tags?

May 3, 2011

I've got an issue with the attached file.

I have 3 buttons & 3 divs.

I would like to hide/show the relevant divs (into a container) based upon the button pressed. If no div was open, then it would simply open the relevant div, however if say div 2 was open and div 3 was pressed, div 2 would toggle closed then div 3 would toggle open.

I've got each individual div opening and closing, but I'm stuck at the next point (checking if a div is open/toggling etc).

View 5 Replies View Related

JQuery :: IE6/7 Do Not .show .hide Divs, All Other Browsers Work Fine?

Feb 5, 2010

Here's my issue, hoping someone can help. I have a page with 5 roundabouts on it showing pictures depending on a button click. Buttons would look like:
DOGS CATS BIRDS FISH REPTILES

So if you click Dogs, I want it to hide the roundabout for Cats, Birds, Fish, and Reptiles but show Dogs. This works perfectly in FF, Chrome, IE8, IE7, but if I view in compatibility mode or with an IE6/7 browser, all 5 roundabouts show and even if I hit the buttons, which fire the show/hide code, nothing gets hidden. Here's some code, I'm hoping someone has a tip on where I am going wrong in getting this simple show/hide of a div.

[Code]...

View 2 Replies View Related

JQuery :: Hide/show Divs Based On Form Parameters

Jun 13, 2009

I'm trying to selectively hide and show divs based on what a user specifies using three select boxes in a form. I'm probably missing something obvious, but here's what I've got and it doesn't, work, they divs just stay hidden.

<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">

[Code].....

View 2 Replies View Related

Toggle DIV - Want To Only Show And Then Not Hide

Jan 25, 2010

I'm using a classic toggleLayer function to display content in a div adjacent to one full of links.

The code is
function toggleLayer( work ){
var elem, vis;
if( document.getElementById ) // this is the way the standards work
elem = document.getElementById( work );
else if( document.all ) // this is the way old msie versions work
elem = document.all[work];
else if( document.layers ) // this is the way nn4 works
elem = document.layers[work];
vis = elem.style;
// if the style.display value is blank we try to figure it out here
if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

And the links take on the format of:
<a href="javascript:toggleLayer('work');...........
My problem is, I want the 'work' div to remain blank, which it does, until I click one of the links. But after that initial click, I don't want the script to act as a toggle, just a show/change content.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved