JQuery :: Saving Chain Minus A Selector?

Feb 24, 2010

I've checked Google and searched the jQuery forum and didn't see anything. Is there a way to do the following as I'd like to use the same chain multiple times with with different selectors:

var chain = .attr('value', 'Search Digital Collections').css('color', '#E0E0E0');

View 2 Replies


ADVERTISEMENT

JQuery :: Select All Inputs That Have A Value Containing A Minus Sign?

May 29, 2010

I am so close to finishing this project and I stumbled upon this block...

<div class="line first">
<input type="text" value="0,00" class="nbr first">
<input type="text" value="" class="date">
<input type="text" value="" class="date2">

[Code]...

I have here two inputs with class nbr. The initial values are set, and those values change programmatically over time. My list of inputs is a lot longer than this but I simplified. You can see the work in progress on [URL]. Just insert two random dates in page1 with the datepicker and the navigation will appear. At the end of a series of calculation I need to grab all inputs with positive numbers, and all inputs with negative numbers.I was thinking of selecting all fields with nbr class first, then use .filter() with a function

edit: nevermind, I found it.

$('input.nbr.first').filter( function(){
if($(this).val().indexOf( "-" ) !== -1) {return true} else {return false}
} )

View 3 Replies View Related

JQuery :: Classname Of Link Not Toggle Between Plus And Minus

May 10, 2010

I've just recently become enlightened by jQuery and would like to add it to my site, but I'm having a little trouble. I made this basic function:
function showPanel(id) {
var panel = $(".further_info." + id + "");
panel.slideToggle();
$(this).toggleClass("minus");
$(this).toggleClass("plus");
}

To give an example of its use:
<a class="panel_control plus" onclick="showPanel(0);"></a> <div class="further_info 0"></div>
The panel is displayed correctly, but the classname of the link isn't toggled between "plus" and "minus."

View 2 Replies View Related

Jquery :: Toggle Plus / Minus Image And Animate Photo

Jun 23, 2011

How to do this but still can't figure it out. I'm currently reading jQuery from novice to ninja but I'm no where close to a ninja. I have a div containing list items, a photo, and a plus/minus button at the bottom of the div. The list items are absolutely positioned behind the photo. When I click on the plus button I want it to change to minus and animate the photo 29px from the top revealing the list-items behind it. Then I want to click the minus button changing it back to plus and animating the photo back up to the top.

I'm trying to accomplish something very similar to what you see on Kyanmedia.com. Except their images animate down and up on hover. I want my image to animate down then up on click and toggle the plus/minus image. I'm new to jQuery so I'm having a real hard time trying to figure this out. Everything I've tried doesn't work. The links to Kyan Media to get an idea of what I'm trying to do.

View 1 Replies View Related

Jquery :: Select Chain In It?

Feb 8, 2009

Is there any chances some one teach me how to do this... in jquery ?

View 2 Replies View Related

JQuery :: Chain Animation For Different Element?

Apr 7, 2011

I'm trying to have an effect happen after an effect for some other elements has finished.

$(document).ready(function() {
$("#about_div").toggle(function() {
$(".work_divs").slideUp(600);

[code]....

and a couple of variations. I increased the duration to slow it down but the effects occur simultaneously.

View 1 Replies View Related

JQuery :: Chain Select Box With Optgroup?

Sep 6, 2009

On change of the first drop down i want another drop down list to get populate with optgroup in it

View 1 Replies View Related

JQuery :: Chain A Function Off A Delay?

Sep 12, 2011

I want to try and keep my syntax all encapsulted, but I'm not sure how to go about this.

So I add in some html to a div
$('#slideStage').append("<div id='popupTiming' style='display:none'>" + formatTime(currentCuePoint.time) + ' minutes</div>')
So the resulting html would be

[Code]...

View 3 Replies View Related

JQuery :: Display Div One By One (pretty Much Like A Chain)?

Jan 9, 2010

I have a list oF div embedded into one

<div id="main">
<div>item 1</div>
<div>item 2</div>

[code]....

View 9 Replies View Related

JQuery :: Writing A Chain Function?

Jun 12, 2011

I'm sure a Google search could answer this, but I don't know what it's called, haha. Dot sytax maybe?chain methodsHow do I write a function that can be called like this:

$('p').myFunction().val('the new value');

I played around, tried this:

function myFunction() {
$(this).css({'color': 'red'});
}

[code]....

View 4 Replies View Related

JQuery :: Alternative To Each Function In Middle Of Chain With One Element

Dec 3, 2011

An example:
tabContent.css('width', '0')
.css('opacity', '0')
.filter(':eq(0)')
.css('opacity', '1')
.parent()
.find('.one-tab')
.addClass('active')
.css('cursor', 'default');

Now I want to apply the parent of tabContent a width, only if a condition is true. I do this, and works, but I don't consider this is a proper way:
tabContent.css('width', '0')
.css('opacity', '0')
.filter(':eq(0)')
.css('opacity', '1')
.parent()
.each(function() {
if (/*condition is true*/) {
$(this).width(aWidth + 'px');
}
$(this).find('.one-tab')
.addClass('active')
.css('cursor', 'default');
});
Is there a better way instead of using each() which is actually made for loops? In this case there is only one element.

View 3 Replies View Related

JQuery :: Using Select-chain, Getting Ajax Parser Error

Mar 24, 2011

I'm trying to incorporateRemy's select-chainplug-in into my code, and I'm having troubles. I hopesomeone can take a minute or two to help me. My situationseemed simple, only 2 levels, Products and Programs under each Product. I have the back-end working, so it returns the JSON list of Programswhena Product ID is passed. However, the plug-in keeps failing in the .ajax() function, tripping the error(). It reports a "parsererror", so I know I've messed up something. One wrinkle, I have multiples of the Product/Program pairs on my page, identified as "prod_x"/"prog_x", so I need to dynamically call them. Here is my code:

[Code]...

View 7 Replies View Related

Using A Minus In Javascript

Dec 3, 2006

I have the following link to bring up an alert with a figure in it based on
the screen resolution. but instead of displaying a number 'NaN' is
displayed.

<a href="javascript:alert('Your ideal estimated height is '+
screen.height*0.55-screen.height*0.2);" class="BodyLink">Click to calculate
height </a>

But when I remove the part of the equation '-screen.height*0.2' a figure is
displayed properly. Why doesnt it work when I have a minus in the equation.
Im not experienced with javascript so excuse if this is a basic question..

View 19 Replies View Related

JQuery :: Pass Data Down To Chain Calls Of Deferred Object?

Dec 11, 2011

How to pass data down to chain calls of deferred object? code...

View 1 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

Passing Plus Or Minus As A Variable?

Dec 26, 2011

if I wanted to set a variable with radio buttons to decide whether a function adds or subtracts, I know I can't do this:

<body>
<input type="radio" name ="op" onclick="op='-'">count up: <input type="radio" name ="op" onclick="op='+'">
<script type="text/javascript">

[Code].....

View 13 Replies View Related

JQuery :: Difference Between Class Selector And ID Selector?

Sep 8, 2011

Are there any difference between class selector and ID selector

View 2 Replies View Related

Check To Make Sure Number Isn't Minus

Jul 6, 2005

I have a form with about 15 input boxes. I need a function that will run onChange in each input box. This function has to check if a number is - or +. If it is -, I need it to throw out an error.

View 2 Replies View Related

Trigger Combination Of Ctrl + Minus

Oct 24, 2010

I need javascript to trigger the combination of ctrl + minus. Is it possible. I need this because the design of the webpage I'm working on is looking much better at 83 % zoom which couldn't be achieved by CSS zoom property in mozzila firefox.

View 2 Replies View Related

Validating A Stringified Scope Chain?

Feb 9, 2009

Let's say I have the string "Bob.underwear.drawer.sortBy" which would be the Scope Chain Required to access an object similar to this:

Code:
var Bob = {
underwear: {

[code].....

View 1 Replies View Related

Swaps A Toggle Image For News For A Plus Or Minus Sign Showing If The Div Is Open Or Closed

Dec 11, 2009

I have this little snippet of code that swaps a toggle image for news for a plus or minus sign showing if the div is open or closed. This code has worked before but i made a couple modifications today and it stopped working unexpectedly and i'm not sure why its failing. I am presetting the div tag with a plus sign with css and then modifying it with javascript. The problem i am having is that when the div tag has been opened it does not swap the image to min.gif anylonger. It remains max.gif.

[Code]....

View 5 Replies View Related

Find Example Of Country Selector Which Also Provides A State Selector If USA Is Chosen

Jun 5, 2009

I'm trying to find an example of a country selector (which also provides a state selector if USA is chosen) then you cvan select the city, any samples out there?

View 2 Replies View Related

Chained Drop Down List, Last In Chain Show / Hide A Div?

Dec 9, 2011

I'm trying to combine a chained drop down list with the ability for the last selection to show/hide a div. I've researched and found ways to do both individually, but I'm hitting the wall when it comes to combining the javascript.

This is how I'd like it to work:

-- User selects from DropDown List 1.
-- DropDown List 2 options appear based on the selection in 1.
-- User selects from DropDown List 2,
-- Appropriate div is shown.

Here's the Javascript I'm using to show/hide a div:

function showDiv(divID)
{
var div = document.getElementById(divID);
div.style.display = ""; //display div
}

[Code]....

View 1 Replies View Related

AJAX :: Chain Selects - Hiding The Select Boxes?

Nov 12, 2009

Is it possible with AJAX chained selects to have one select box on the page and then have another select box appear depending on the selection from the first select box?[URL]Is it possible to hide the 2nd box until the first one was acted upon?

My goal is to start with one box (call it Box 1). Box 2 will then appear. Depending on Box 2's input, Box 3 will appear with new choices. Depending on Box 3's input, Box 4 will appear....so on and so forth until the end goal is met.

When additional boxes appear, I do not want the previous boxes to disappear. If PHP can populate the select boxes, I don't see why it also couldn't insert the physical select box.

View 2 Replies View Related

JQuery :: Saving A Value And Incrementing It?

Apr 21, 2011

I am making a LOVE IT button using php and jquery and i have most of it working...

The button currently returns the value from the DB of 0 but when i click the button it wont save the incremented value to the DB.

see it here[URL]

my code is this

<?php
mysql_connect("localhost", "web183-loveit", "password") or die ("Error.");
mysql_select_db("web183-loveit") or die ("error");
$increase = "UPDATE results SET value=value+1 WHERE id=1;";

[Code].....

View 1 Replies View Related

JQuery :: Saving A PDF File On The Server?

May 6, 2010

I'm trying to save a PDF file that's built using the jspdf PDF JS files [URL], the example (server side) uses Jaxer to save the file to the hard drive. Can i do this via JQuery instead? PDF Example

<script runat="server" type="text/javascript" src="../libs/base64.js"></script>
<script runat="server" type="text/javascript" src="../libs/sprintf.js"></script>
<script runat="server" type="text/javascript" src="../jspdf.js"></script>
<script runat="server" autoload="true" type="text/javascript">

[Code].....

View 1 Replies View Related







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