jquery

Using .fadeOut(), but I want it to STAY faded?

I am using this code to make a certain div (#extras) fade out. $(document).ready(function() { for(var i = 1; i <= pageLimit; i++) { $('body').append('<div id="page' + i + '" name="page' + i + '" class="touch"></ div>' ); } $('body').append('<div id="extras" class="showUp">..all cont...

Jquey vertical list slider wont repeat more than once

I have a vertical slider that works well except when it needs to scroll more than once. view slider This is the code $(document).ready(function() { var speed = 1050; var elementHeight = 106; var countElements = $('#portfolio-navigation ul li'); var numberElements = countElements.length; var totalHeight = numberElem...

jQuery ajax is not working on Mozilla only

I have following script $.ajax({ type:"GET", url:"views/jquery/js/private/visual_constructor/proxy.php", data:null, timeout:55000, dataType:"xml", error:function(XMLHttpRequest, textStatus, errorThrown){ alert("error="+XMLHttpRequest+" error2="+textStatus+" error3="+errorThrown); }, success:function(res...

How can I prevent the width changing when using jQuery's slideUp?

I have a test-case here: http://www.jsfiddle.net/kPBbb/ Once the content has .content, the .wrapper shrink-wraps itself, presumably because the .content is display: noneed. I would like the .wrapper to behave as if the .content were still there after the animation, maintaing the initial size. The .wrapper has been float: lefted in ord...

jquery - return value using ajax result on success

Hi guys, I have a small problem with jquery $.ajax() function. I have a form where every click on the radio button or selection from the dropdown menu creates a session variable with the selected value. Now - I have one of the dropdown menus which have 4 options - the first one (with label None) has a value="" other have their ids. ...

css selector jquery problem

I have the following code $(function() { $('#totalRecords').css('visibility', 'hidden'); alert("hi"); }); Problem is that it doesnt hide my drop down which is <span id="lblCodes" class="pol" style="top:4;left:209;">Codes</span> <span id="totalRecords" class="pol" style="top:4;left:350;visibility:visible;"> <select id...

How should I verify the page DOM when attaching jQuery/javascript events to elements?

I'm using jQuery to add events to DOM elements. As I do this, I often times use selectors that technically could gather a list of matching items rather than just a single one. e.g. using the .children() and .find() methods I could find 0, 1 or many matching DOM elements. Do I simply need to check .size() == 1 on every element as I att...

Jquery: How to process a div after you have appended or set data to it optimally

I think this question is better served with an example. I have the following code: $.get('path/'+id,function(data){ $('#mydiv').html(data); $('.editable').button().click(function(){ //process here }); }); And it works just...

call the same function on many events

i need to call the same function on many events $("#test1").click(function(){ some_function(); }); $("#test1").hover(function(){ some_function(); }) how can i write this with one function? Thnaks ...

Jquery function creation vs. no library problem

I have code that relies on jquery that works here: $(function() { var referrer = document.referrer; var dataText = 'client='+client+'&referrer='; dataText = dataText + referrer; // Create the AJAX request $.ajax({ type: "GET", url: "http://www.myurl.com/project/thecollector...

What's the technical difference between jQuery arrays and jQuery objects?

Of these two, which is correct? jQuery('someclass').click(function() { alert("I've been clicked!"); }); or jQuery('someclass').each().click(function() { alert("I've been clicked!"); }); I'm wondering if I have a fundamental misunderstanding of how certain aspects of jQuery work, or if it's just got a lot of tolerance built into...

What is the Prototype equivalent of JQuery's $(element).text()?

Given the following snippet: <div id="myDiv"> This is my text <span>with a span</span> </div> JQuery can get the interior string with: $('#myDiv').text(); Is there a more intuitive way in Prototype than: $('myDiv').pluck('innerHTML').first().stripTags(); ...

Check if optgroup by id/label exists in jquery?

I have a dropdown, and in another process add optgroups/options to that dropdown, and that part works fine. But I may need to add similar optgroups, with more data, and I want to check for the existence of that optgroup, and if it exists, don't add it, but just add options to the existing optgroup. I have been searching around, and can...

jquery - clicking outside of div

Right now, I just have something that slides open if hovered over, and slides closed if the mouse leaves. I'd like if I could keep it open until someone clicks outside of it. Ideas? ...

Recursively access iframes after they've loaded with jQuery

I've looked at the related questions here but am having a slightly different problem. I am rewriting anchors across nested iframes, sometimes 3 or 4 iframes deep. I use .load( function(){} ) to wait for each to load before accessing the anchors. This works fine when only going one iframe deep, but fails after that. Here is the code: ...

ASP.NET and jQuery AJAX - strange problem

Hi, I've got this strange problem... I've got a web service running against jQuery front-end. When I run it through the integrated web server of VS2008 - it works great. But when I use the IIS itself - I get this error: System.InvalidOperationException: Request format is invalid: application/json; charset=utf-8. at System.Web.Servi...

Better performance for selecting options by value with jQuery?

I am trying to work out some performance problems with some JavaScript I've been working on for a few days. One of the pieces of the functions is below: var removeAddress = function(pk) { var startTime = new Date(); jQuery('.add_driver select.primary_address:has(option[value=' + pk + ']:selected)').each(function(c, o) { ...

jquery ajax + inline Javascript

Hi guys, hopefully this will be an easy fix.. I use this script to load content into a Div wih Ajax... $(document).ready(function() { $('.top_nav a').click(function(){ var toLoad = $(this).attr('href')+' .content'; $('.content').hide('slow',loadContent); $('#load').remove(); $('#header_resize').append('<span id="load">Pleas...

does mousedown /mouseup in jquery work for the ipad?

I am using the current code: $('body').mousedown(function() { $('div#extras').fadeTo('fast', 1); }); $('body').mouseup(function() { $('div#extras').delay(2000).fadeTo(1500, 0); }); This works great in safari but when I upload it and check it out on the ipad it doesnt work? ...

Can the Javascript Module Pattern be used for singletons and also for objects that are instantiated mutliple times?

I have one page with two types of forms. I have a single form of type A at the top, and then I have 1 or more forms of type B below it. I use the Module pattern + jQuery to wire up all the events on my forms, handle validation, ajax calls, etc. Is this the preferred/valid way to define a singleton, as in Form A, and a reusable object ...