JQuery :: How To Make Use Of Not Function - Performing Conditionals

May 1, 2010

Obviously I'm not quite understanding .not() because the following code does not perform identically:
if(!$(this).is('.current')) { some code }
and
if($(this).not('.current')) { some code }
So that I can make use of .not(), how would I write the second conditional so that it performs as the first conditional?

View 2 Replies


ADVERTISEMENT

JQuery :: Html() Performing Before Hide() When Called After It?

May 24, 2010

http://livescore-bg.net/srpski.htmlI want when I change some of the menus 3 thing to happen in the folowing order:1) Old flag to hide()2) New flag to be on its place, IN THE MOMENT THAT this is not visible, I mean, in the moment in which the hide() action will already be performed.3) New flag to fadeIn()As you can see after some tests on the url shown, FIRST it replaces the flag, and after that it hides the old and shows the new one. Here is my first version of the code:

Code:
$(".zastavaholder").each(function(){
$(this).hide(1000);

[code]....

View 5 Replies View Related

JQuery :: Anchor Tags Not Performing Correctly In A IE 8 Dialog Using V1.4.1 Or V1.4.2

Mar 2, 2010

I am currently having a problem with a couple anchor tags that I have on a jQuery modal popup (using jQuery-ui-1.7.2.custom.js for the modal popup).Both of them will work correctly when I use jQuery v1.3.2 in any browser but they will not work anymore when I upgrade to v1.4.1 or v1.4.2 in IE 8. Chrome and FireFox will continue to work like they did in the previous versions.

When a user clicks on one of the anchor tags the action should perform without posting back. I have set up the onClick like thisonClick="javascript: return false;" which should prevent them of posting back but it looks like itsignoringwhat is returned and posting back. The logic I am using here is also used on another page but without the modal popup. Everything works fine on that page with every browser for jQuery v1.3.2, v1.4.1, and v1.4.2.

One thing l would like to point out is one of the tags is a select all button which uses .live() so I can select all the checkboxes on the modal popup. The reason I point this out is because other posts like live-method-for-change-event-broken-in-jquery-1-4-2-for-ie-worked-in-1-4-1 also had problems with IE 8 and .live(). My problem and theirs might be related.

View 2 Replies View Related

JQuery :: Performing Action Before An Ajax Async False?

Nov 16, 2011

This code

$('button').click(function(){
$('body').append('<div>I am working</div>');
$.ajax({
async:false,
});
});

Doesn't display the "I am working message" until the ajax call is complete.

[Code]...

View 1 Replies View Related

Conditionals Dice Rolls

Nov 5, 2004

I am having trouble creating a page that stimulates a large number of dice rolls and computes the average of the dice totals in an separate text box. Code:

View 1 Replies View Related

Conditionals In Switch 'case' Labels

Jul 20, 2005

Is this sort of thing possible:

var X = 'Moe'
switch (X) {
case 'Curly'||'Moe'||'Larry':
alert('Found one of the Three Stooges');
case 'Chico'||'Harpo'||'Zeppo'||'Grouco'||'Gummo':
alert('Found one of the Marx Brothers');
default:
alert('No matches');

This gives 'No matches' unless I only put a single string in the 'case'
lines. I've just been using VB's Select Case which is a similar flow
control but which allows conditional arguments in the 'cases'. I just
wondered...

I realise you could put each set of names in an array and iterate
through each array, but that's a different issue.

View 4 Replies View Related

Validating A Form With Multiple Field Conditionals?

Dec 8, 2009

I am somewhat a noob at js/jquery so I wasn't sure exactly how to do this. Think I just need a push in the right direction. Basically I'm trying to validate a form (jquery validation) with a couple of conditionals based on a selection box. So I have:

<form id="info" class="validate">
<select id="select">
<option value="senior">Senior Citizen</option>

[code]...

I'm trying to validate that if the user has selected "Senior Citizen" then their age must be 65 or older (and validate the adult/child ages as well).

View 6 Replies View Related

Php Page Loaded Into Div Not Performing?

Mar 29, 2010

I am trying to call a javascript method on a page that is loaded into a div with ajax.I cannot get javascript functioncalls to work.And I don`t know why,that is when I run the page in its own browser window it works.Can I do it different to ensure it loads javascript?

Code:
<?php
session_start();
require_once("CartClass.php");[code].......

View 12 Replies View Related

Performing Calculations In A Webpage With An External Javascript File

Jan 13, 2006

I work for a small college and we were recently given permission to use a particular GPA calculator on their website. They sent us a javascript file, that I now have. I am trying to incorporate this into our website, but I don't really know much about javascript and I am having trouble making it work.

You can view the GPA calculator here to help clarify what I mean... If someone could just help point me in the right direction or if anyone know a site with tips that would be helpful to me..

View 3 Replies View Related

JQuery :: Checkboxes Won't Make A Call To UpdateResults Function Within $function()?

Jun 11, 2011

I have a real perplexing issue. In two separate "projects" I had code that displayed checkboxes - when clicked, they would fetch information from a db and display it in the div below. I had code that displayed a jquery date-picker - when clicked, it would fetch information from a db and display it in the div below. My issue comes with this:

[Code]...

View 1 Replies View Related

Multiple Prompts>formulas>answer | Performing Trig Based On Prompts?

Mar 26, 2009

I am trying to set up a simple web page that requests two inputs and upon these input, determines and angle (basically taking a Spur Gear Pitch � and threads pitch to get a cam angle). Here is what I have but it is not working. I actually want it to work onClick of a button but I can deal with that later. I just am not sure how to get this to work properly.

<html>
<head>
<script language="JavaScript"><!--
function getCirc(dia){
return dia*Math.PI;
}
function getRad(x,y){
[Code]....

View 4 Replies View Related

JQuery :: Make A JS Function Work As A Link?

Oct 17, 2010

I'm new to jQuery, but learning fast, and loving the new functionality!I'm using a Flash upload component that all works fine, and once it's complete (file uploaded) it calls function.I'm running the Flash upload in a modal (nyroModal - very cool!). The link below does what I need it to do - navigate to a new page and re-size the modal:<a href="test2.aspx#blabla" class="nyroModal">Ajax Filtering Content #test</a>What I need to work out is how to make the JS function above work in the same way as this link. I know very little JS, but I think the 'class="nyroModal" needs to be part of the link in the function some how??

View 3 Replies View Related

JQuery :: How To Make Function Private Or Public

Dec 31, 2011

This question applies to javascript generally as opposed to jQuery specifically. I want to be able to structure my scripts into classes, then create them using the "new" keyword, but here is the important bit: How do I make a js function private (or public for that matter)?

View 4 Replies View Related

Jquery :: Make The Cycle Function In Unobtrusive?

Nov 16, 2009

Does anyone know how to make the cycle function in jquery unobtrusive?

I've got the following code and when I disable javascript, I get a nasty long list of images :(

Jquery code:

Html code:

View 1 Replies View Related

Jquery :: From One File To Another - Calling Make Fancy Function

Oct 8, 2010

I have two javascript files that execute some code. One is a default file loaded on all pages that executes some jquery for some bells and whistles for basic interactivity :

default_jquery.js
Code:
$(document).ready(function() {
function make_fancy(){
//make tables look nice
//make hover look nice
//etc
//etc
}
make_fancy();
});

It works great. However, one of my pages updates a database via ajax and then rewrites and redisplays the updated table on a successful ajax return. For example, if someone adds something to their shopping cart, ajax queries the database, updates an entry, and then rebuilds the shopping cart to reflect the new item or quantity. The problem I was having was that after the rewrite of the table, I was losing the formatting that the above jquery file was implementing. So I just added the same jquery statements above to the success indicator of the ajax.

My ajax looks something like this:
buy_item.js
Code:
$.ajax({
type: "POST",
url: "../buy_item.php",
data: "item="+item+"&quantity="+quantity,
success: function(resp){
//redraw table .....

This works fine, and reapplies the styles after the table has been redrawn. However, I don't like to have the same jquery statements in this file as I do in the standard jquery file above. So I just want to use a function. So on this buy_item.js page, I'm trying to call the make_fancy() function in the default_jquery.js file, but it doesn't work. I'm told that the make_fancy() function is not defined. I've tried including the default_jquery.js file which contains the make_fancy function before the buy_item.js file that calls it, but that doesn't work for some reason.

What I want is this for the buy_item.js page:
Code:
$.ajax({
type: "POST",
url: "../buy_item.php",
data: "item="+item+"&quantity="+quantity,
success: function(resp){
//redraw table
make_fancy();
},
error: function(e){
alert('You suck at this');
}});
}//function

View 1 Replies View Related

JQuery :: Make A Function To Be Able To Change The InnerHTML Of That Div But It Didn't Work?

Jan 5, 2011

I don't really know how to say this, that's why I'm going to show you some code which will hopefully point out what I mean.This is what I wrote yesterday:

var div = $('<div></div>').attr('id','box').fadeIn(1250);
$('body').append(div);

This worked well, but then I wanted to make a function to be able to change the innerHTML of that div but it didn't work.

function changeContent(content) {
var box = $('#box');
box.html(content);

[code].....

View 2 Replies View Related

JQuery :: Disable A Hover Function And Make The Attributes Permanent?

May 30, 2011

see there is a featured section with 3 images on the homepage ... there's a left image, center image and right image ... when you hover your mouse over the left or right picture, an arrow and a white overlay shows up so you're able to switch the images ... i'd like to take away the hover and instead make that arrow and white overlay permanent. This means that once the website is loaded, the arrow and white overlay is already there without having to hover the mouse pointer over the image ... here are the specific codes that controls the animation ....

jQuery('.next-block a').live('click',function(event){
event.preventDefault();
if (!et_animation_running) rotate_slide('next');

[code]....

View 3 Replies View Related

JQuery :: Callback Function Required To Make Ajax Call

Jul 15, 2010

On a project I got stuck on this "problem". When you make a json (ajax) call. You also need a callback function. Which means I have to call the next $.getJSON within that callback function to read the next portion of data. In my opinion this is not very readable code...What I want is a nice and readable piece of code. Where you could just write it like this:
var data1 = $.getJSON(..);
var data2 =$.getJSON(..);
I've found a solution here: [URL] (explains my problem perfectly). But it's not compatible with the getJSON story. Is there already a possibility to do this with the jquery library?

View 9 Replies View Related

JQuery :: Stop Function - How To Make Dynamic Menu Using Library

Apr 1, 2010

I'm having trouble using the stop() function. I'm trying to make a dynamic menu using jquery library. This menu is now working pretty correctly but I can't manage the problem of multiple queued animations. My menu is made in two parts. The first one contains buttons. When they're hovered over, the second level of the menu appears just underneath. But when several buttons of the first menu are hovered over, I can't stop the second level to appear and disappear anarchically. Here is an example of code of the second menu :

<div class ="menu_deroulant">
<!-- ######## Menu Déroulant niveau 1
|| Accueil ####### !-->
<div id ="menu_deroulant_accueil">
<div class
="nom_speedbarre"
>Accueil</div>
<ul>
<li ><a href="***.php" .....

View 2 Replies View Related

JQuery :: Make A Conditional Function For A Menu So The Current Link Does Another Roll Over?

Nov 1, 2010

I'm trying to build a menu with an animation color and my problem is that the funtion is apply to all the links in the menu but ideally I would like to apply to all elements less the one with the id current.

at the moment I just created two functions but still apply both of them to the current link.

Here is the code:

<script type="text/javascript">
// font color animation
$(".second a").hover(function() {
$(this).animate({ color: "#00aadd" }, 400);

[Code].....

View 1 Replies View Related

JQuery :: Make Script Smaller By Creating A Function That Controlls Every Textboxes Instead Of One Textbox?

Aug 18, 2010

make my script smaller by creating a function that controlls every textboxes instead of one textbox. See below my code that I want to make it smaller...

$(".searchField").focus(
function()
{

[code]....

View 2 Replies View Related

Make A Function Trigger A Other Function?

Jul 28, 2011

How would you make a function trigger a other function?

View 10 Replies View Related

How To Make A Function Run When Web Page Loads.

Jul 20, 2005

I have a slide show program. First theres stuff to set up the array, and the time between slides Then a function startIt()is defined then a function stopIt()
Then two buttons, Start and Stop, which when pressed call the relevant
functions.

When the page loads, you have to click the Start button to get the
slide show running, but I'd like it to start running straight away
without having to click. I can't for the life of me figure this out.
I thought it was just a question of putting the line
startIt(); Code:

View 2 Replies View Related

Make A Variable Available To Other Functions Outside A Function?

Feb 12, 2010

Is it possible to make a variable available to other functions outside a function So to make it global from within a function without using a callback

function() {
var something = 'hello';
}
function(something) {
document.write(something);
}

something like that possible??

View 1 Replies View Related

JQuery :: Make A "while" Function To Replace The Code With New Content?

Feb 15, 2011

i try to use ajax with jquery, but i have a problem to make a "while" function inside my jquery file, to replace the former content of a div with the new one :at the beginning i load all the content through php, with a "while" function and then i create the links :

<div
id=
"blocus"

[code]....

View 1 Replies View Related

JQuery :: Cannot Make Function Run On "load" Event

May 2, 2009

i use jQuery 1.3 and would like to make the following code run as soon as the elements i am targeting have loaded (or as soon as the page has finished loading). At the moment, I can only get it to fire on an event related to the target (in code below i'm using "hover"). Ihave put this snippet of code inside the document .ready handler, which is where I assume i should put it (?):

[Code]...

View 2 Replies View Related







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