JQuery :: Accordion Starts With All Sections Closed Until Clicked?

Jun 16, 2011

I've created an Accordion but by default the first menubar is open, is there a way to have all menu bars closed?

Is it the "active: 0" option? How can I disable it so that the accordion starts with all sections closed until clicked?

View 3 Replies


ADVERTISEMENT

JQuery :: Selecting Sections - Delete (actually Hide) Either A Salesperson Or Client Depending On Which Link The User Clicked

Jul 18, 2011

I am building a web application using PHP. It lists each salesperson and below it, the clients assigned to them. There are only about 5 or 6 salespeople. There could be any number of clients for a salesperson. Each salesperson is given their own div and client information (name, email, phone) is grouped with an unordered list:

Code:
<div id="salesperson-1">
<h1>Salesperson 1</h1>
<ul>
<li>Steve Smith</li>
<li>steve@company-a.com</li>
<li>555-5555</li>
<li><a href="#">Delete Client</a></li>
</ul>
<a href="#">Delete Salesperson</a>
</div>

I would like to be able to delete (actually hide) either a salesperson or client depending on which link the user clicked. I have been using JQuery throughout my site so far and I can accomplish the task for the salespeople by creating individual events for 6 salespeople. If there are only 5 people, the 6th event will never be triggered. If there are 6, everyone is covered. The tricky part are the clients since I can't guarantee a specific number of them. I would like to fit best practices as much as possible and reduce the complexity of my code if I can. Keeping that in mind...Is there a better way to handle the salespeople rather than rewriting the function 6 times? Can I pass a variable to a JQuery function using the onClick binder on the <a> tag --> <a href="#" onClick=deleteClient(10)> and use the variable to determine which client to delete? Would using a function in plain javascript and ignoring JQuery for this entirely be better?

View 2 Replies View Related

MooTools - Accordion To Have The Default Position With All Rows Closed

Mar 1, 2011

I have a Mootools accordion. The code is the following:

Code:
<script type="text/javascript">
window.addEvent('domready', function() {
var myAccordion<?php echo $uniqid; ?> = new Accordion($('accordion_sp1_id<?php echo $uniqid; ?>'), '.toggler', '.sp_inner', {
opacity: false,
onActive: function(toggler, sp_inner){
toggler.addClass('active');
[Code]....

I need that acordion to have the default position with all those rows closed. Now, I have a row active by default.Plus that, I want that the clicked row (despite that is active row) to be colapsed.

View 1 Replies View Related

JQuery :: Keep An Accordion Menu State After Link Is Clicked?

Oct 5, 2010

I have an accordion effect setup on a a nested list. The effect is working great however, I want to retain the menu state (e.g. which section is open) when a user clicks a particular link and the site loads a new page.How do I do this with jQuery?Here is the jQuery I have currently:

$(document).ready(function(){
$('.boxCategories ul > li ul')
.click(function(e){

[code]....

View 10 Replies View Related

Keep An Accordion Menu State After A Link Is Clicked?

Oct 6, 2010

I have been using the Sitepoint book jQuery from Novice to Ninja. I'm still very much a novice but I'm making some progress...I have a jQuery accordion effect set-up on a a nested list. The effect is working great, however, I want to retain the menu state (e.g. which section is open) when a user clicks a particular link and the site loads a new page. I'm thinking I must need to use a cookie or similar but have no idea how to implement this. Here is the jQuery I have currently:

Code JavaScript:
$(document).ready(function(){
$('.boxCategories ul > li ul')

[code]....

View 1 Replies View Related

JQuery :: Accordion - Stop The Rollover Effect In The Sub Menus Until The Accordion Animation Is Finished?

Aug 5, 2010

I created an accordion menu with rollover sub menus. My question is there a way to stop the rollover effect in the sub menus until the accordion animation is finished? When I click on a category link on the accordion the sub menu links flashes until the animation is done.

View 1 Replies View Related

JQuery :: Difference Between Accordion Widget UI And Accordion Plugin?

Oct 1, 2009

explain to me the difference between the two? I just finished an online tutorial on Accordian Widget UI and it

View 5 Replies View Related

JQuery :: Opening Tabs And Linking To Sections Within Show / Hide

Mar 25, 2011

1. I am trying to figure out how to open a tab, open a show/hide within that tab, and link to a particular person from an incoming link.
2. I also am trying to figure out how to open a tab and then a pane within that tab from an incoming link.

This is the code used for the tabs
<script type="text/javascript">
$(document).ready(function() {
$("ul.main.tabs").tabs("div.main.panes > div", {tabs: 'a.main', history: true });
$("ul.nested.tabs").tabs("div.nested.panes > div", {tabs: 'a.nested', history: true });
});
</script>

This is the code used for the toggle
<script type="text/javascript">
// Andy Langton's show/hide/mini-accordion - updated 23/11/2009
// Latest version @ [URL]
$(document).ready(function() {
var showText='+/-';
var hideText='+/-';
var is_visible = false; .....

View 9 Replies View Related

JQuery :: Making Multiple Divs Appear Or Disappear When Diff Sections Of Site Are Scrolled To?

Jul 14, 2011

I am trying to create a fixed crest at the top of my site that changes depending on where the viewer of the site scrolls to.

I found the following script/plugin on StackOverflow that works well for making one element fade in and fade out.

PART ONE:

function isScrolledIntoView(elem) {
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $(elem).offset().top;

[Code].....

I then duplicated part two and changed the variables to make a different div appear in this position depending on where the viewer was in the site but it did not work past the first transition. see the following link to get a better idea what I am trying to achieve.

[URL]

Is there any way I can adjust the script to make it work with multiple transitions?

View 2 Replies View Related

JQuery :: Find The Given Value Which Exactly Starts With In Select Box

Jun 10, 2011

I would like to get the function to find the value which is starts with given value in select Box. If jQuery does not support please let me know how to do using Java script.

I am using contains function but it returns all the matched values. Get the value value exactly starts with given value.Select box :

<select class="widthed1" name="dynamicitem" id="dynamicitem" multiple="multiple" size="7" >
<!-- Will be added dynamically -->
</select>
$("#dynamicitem option:contains
('"+oldval+"')").attr("selected","selected"); -- It returns all the matched values.

View 8 Replies View Related

JQuery :: Slide Down Starts Late?

Jun 4, 2009

I have a jquery slidedown effect which id triggeref onchange of dropdownBut the slide down effect starts a few seconds after the option is change.It delays

View 1 Replies View Related

JQuery :: Check If The Method Of Text () Starts With A 1?

Mar 8, 2011

How do I check if the method of text() starts with a 1

View 1 Replies View Related

JQuery :: Set A Number Inside H1 Tag Before Text Starts?

Oct 21, 2009

I am using the table of contents function of rebecca murphey. The script works fine, but i need to extend itin two ways.

1. set a number for each toc element?

2. set exactly this number to he h1 inner html in fron of the text?

So that the result is[code]...

View 5 Replies View Related

JQuery :: Prevent Action To Be Executed Before It Starts?

Apr 27, 2010

I am building a navigation which animates width on mouseover and revert it on mouseleave. That navigation also supports keypress/keydown actions, so it behaves like you hover with the mouse and additionally opens the submenu too. My problem is, when using the keydown (C) function, the menu opens up perfectly but when I mouseover then, it fires the 1. function and behaves like it should, it closes. I tried to stop that when just using keydown, but somehow I am stuck with it. Here comes the code:

$
(
function
()

[Code]....

View 4 Replies View Related

JQuery :: Select An Element That Starts With A Particular String?

Apr 4, 2011

How can I select an element that start with a particular string and ends with another string.

View 1 Replies View Related

JQuery :: Submitting Form After Animation Starts

Feb 17, 2011

I have a small problem with a form. After I click on a submit button a small animation starts, I would like to submit form after animation but nothing is working. I tried different methods and I also checked html for errors.

Code of function:
$(document).ready(function(){
$("#button").click(function() {
var productX = $("#first").offset().left;
var productY = $("#first").offset().top;
var basketX = $("#basket").offset().left+15;
var basketY = $("#basket").offset().top+20;
var gotoX = basketX - productX;
var gotoY = basketY - productY;
var newImageWidth = $("#first img").width() / 3;
var newImageHeight = $("#first img").height() / 3;
$("#first img") .....
.clone()
.prependTo("#first")
.css({'position' : 'absolute'})
.animate({opacity: 0.9}, 100 )
.animate({opacity: 0.6, marginLeft: gotoX, marginTop: gotoY, width: newImageWidth, height: newImageHeight}, 1200, function(){
$("#detailstext").submit(); //form id
});
return false;
});
});
I also tried
$("form_id").post(0).submit();
but i got error:
$("form_id").post is not a function

View 6 Replies View Related

JQuery :: Calculate Number Of Inputs Where Name Starts With Name^ And Input Value Is>0?

Sep 8, 2010

I have many inputs with name totalsum1,totalsum2,totalsum3 etc. I need to calculate number of inputs where name starts with "totalsum" and value is >0. I need to send result to another input with id="#rowtotal".My code:

$("#rowtotal").val(($("input[name^=totalsum]").val>0).size()); It's not working. Best RegardsRafa‚ Koszyk

View 1 Replies View Related

JQuery :: Find The First Element That Starts With Some Arbitrary Char?

May 4, 2011

the jquery way to get the first char, of the first element that starts with some arbitrary char...

So I have a list of anchors, a person clicks on the letter and I want to search the list for the firstoccurrenceof that character :

<div id="dirnav">
<a id="A" href="#">A</a>
<a id="B" href="#">B</a>
<a id="C" href="#">C</a>

[Code].......

how to find,say, thefirstspan element with the content that starts with 'L'.

View 4 Replies View Related

JQuery :: Loading Image Before Operation Starts Not Working?

Jun 16, 2009

i have following problem: When the user on my website presses a image link, I prevent the default behaviour, and toggle some table rows (show or hide them, depending on the the image src (closed.gif / opened.gif)). Since I got a lot of rows I run over and toggle, the function takes some time to process and the browser "hangs" in the meanwhile. Due to this I want to show the user that the operation is still in progress and want to change the image of the link to a load spinner until it is finished. So I thought that I just have to change the src URL of the image in advance and then start the function, but jQuery is ignoring the line and I don't know why? Here is the code I am using:

$("a[name='changeDisplayModeAll']").click(function(e) {
e.preventDefault();
var newStatus;
var imageSrc = $("img[name='imageChange']").attr('src');

[Code]....

View 1 Replies View Related

Jquery :: Unstyled Images Displayed For Second Before Cycle Starts

Apr 17, 2009

I'm trying to implement the jQuery Cycle demo from 'mapsup dot com slash jquery'.It works, but my problem is that as the page loads all 3 images are shown briefly, one on top of the other. Once the page is fully loaded everything works OK. I've try removing all unnecessary CSS in an attempt to get it to load faster but it doesn't help. I'm running this on a Drupal site and have tried with caching enabled and disabled, but neither makes a difference, so I'm thinking the problem lies somewhere else. You can see the problem in action at 'cumbrevillas dot com slash landing slash test'.

View 1 Replies View Related

Reordering DIV Sections

Jan 31, 2006

I have 12 div sections on a page and I want the user to be able to
specify the order in which they appear on the page. I'm thinking of
something like this but want to ask what people think of this approach
and maybe suggest another way or an article on how to do this.

// grab the innerhtml by:
var theSpan1 = getElementById("span1")
var theSpan1HTML = theSpan1.innerHTML

// then grab the innerHTML of the span you want to "swap" it to:
var theSpan2 = getElementById("span2")
var theSpan2HTML = theSpan2.innerHTML

// and switch the innerHTML's of the span by:
theSpan1.innerHTML = theSpan2HTML
theSpan2.innerHTML = theSpan1HTML


<form>
<span id="span1">
<div id="div1">
<select size="1" name="ddlOrder1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
Span1/Div1
</div>
</span>

<br />

<span id="span2">
<div id="div2">
<select size="1" name="ddlOrder2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
Span2/Div2</div>
</span>

<br />

<span id="span3">
<div id="div3">
<select size="1" name="ddlOrder3">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
Span3/Div3</div>
</span>
<input type="submit" value="Save Profile" class="smalltext"
name="btnSaveProfile" onclick="changeOrder()">
</form>

View 2 Replies View Related

JQuery :: Fire Fox 5 - Chain Of Animation Starts In The Child Element?

Jun 23, 2011

I created a dropdown menu using jquery. So when I hover over a button it slides down the menu. Now if I move the mouse out of the menu and bring it back in before it slides up(menu has a lot of items so there is enough time to bring the mouse back in on the menu)over the dropdown menu it starts a chain of slideDown() and slideUp() functions and it does not stop till I move the mouse of the menu or back on the button. Below is my jquery code:

[Code]...

View 1 Replies View Related

Sections Not Collapsing Properly In Firefox

Jul 23, 2005

I've got a page that shows a number of packages available for sale. Each
package has a little description, and then a (sometimes long) list of
features for each package. I thought it would be a good idea to let
visitors hide the details for each package, so that they can see just
the summaries together. So I borrowed some code (can't remember from
where), which was designed for expandable/collapsible menu trees, and
used it to show/hide the details of the packages.

The code works fine, but the only problem is that when you hide a
section, the page doesn't resize itself. The text underneath moves up,
but below that a huge empty space is left. The scroll bars should change
to reflect the page's new (smaller) length, but instead they stay the
same, and let you scroll through all the empty nothing at the bottom of
the page.

I've tested the page is IE6 and Firefox 0.9 - I only have this problem
in Firefox, in IE the whole page shrinks and the scroll bars change
accordingly. Any suggestions? I though maybe I need to call some
javascript function to refresh/recalculate the page - I tried using
document.normalize() straight after the section got hidden, but it
didn't help. Any other such functions that might do the trick?

Here's the code:

View 4 Replies View Related

Make Various Sections Of Image Clickable

Dec 8, 2011

I created this thread on the html forum but I'm not sure if it can be done with javascript, so I'll post here as well. I was wondering if there's a way to make various sections of the image clickable? The sections on the image are not rectangular so I can't make divs. I don't think I can use imagemap either since that only works for making one clickable area right? I already cut out these sections in photoshop and saved them with alpha background, and created a "glowing" version of each section, since I want to make it so that when mouse hovers over it, it will glow. But I can't stack them on top of each other, since if I do that only the topmost layer will be clickable for those areas where they will overlap with rectangular divs. This is example of what I mean: [URL]

View 6 Replies View Related

Make Various Sections Of Image Clickable?

Dec 8, 2011

I created this thread on the html forum but I'm not sure if it can be done with javascript, so I'll post here as well. I was wondering if there's a way to make various sections of the image clickable? The sections on the image are not rectangular so I can't make divs. I don't think I can use imagemap either since that only works for making one clickable area right? I already cut out these sections in photoshop and saved them with alpha background, and created a "glowing" version of each section, since I want to make it so that when mouse hovers over it, it will glow. But I can't stack them on top of each other, since if I do that only the topmost layer will be clickable for those areas where they will overlap with rectangular divs.

View 1 Replies View Related

Hide / Unhide DIV Sections With Check Box

Mar 7, 2003

I was wondering if someone could tell me what i'm doing wrong here. Real simple code, but it doesn't work. BTW, I really only care for this to work with IE 6+.

View 14 Replies View Related







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