jquery

Variable and jQuery selector

Ive been trying to figure this one out for about 2 days and cant understand why this isn't working. Say for example I declare a variable "ul" and want to say var + li display red. $("document").ready(function() { var menu = $("ul"); $(menu +" li").css("color","red"); }); All list items should now be red. What am I doing wrong? ...

How do you escape parentheses in jquery selector?

I am trying to check if a td innertext contains parentheses (). The reason is I display negative numbers as (1000) and I need to convert them to -1000 to do math. I've tried a couple different ways but can't seem to get it right. I know there are non-jquery ways to do this but at this point it's just bugging me. $(tdElement[i]).find("\\...

jquery pagination not working

Hi, I am currently trying to make the pagination plugin work with my site. When I load the page I get no errors when using firebug, but there are no numbers that displayfor the results. It's driving bunkers. Here is the JS file that I am using: function handlePaginationClick(new_page_index, pagination_container) { // This selects 2...

Add div above textbox without changing position of textbox

I need to add some HTML content (images, labels, etc.) above a table cell that contains a text box. There are going to be at least 10 rows per page with 8 columns in each row. All 8 columns contain a text box. I've already put together some jQuery that will show and hide this new content area above the table cell, but the CSS is not c...

Copy class from one element to another

Say for example I have a body with the class "test" and I want to take that class and add it to another div, how can I do this with jQuery? Thanks Edit: Something like this? $("body.test").clone().attr("class").prependTo("div"); ...

Is there a jQuery poll plugin?

Looking to make a simple poll, does not even need to be cookie based I don't care how many votes are cast. Is there a plugin or something simple like this? ...

How to select child from parent by class starting with $(this)

I'm creating a custom jQuery plugin to add a few images above an input box. The highlight class are working perfectly, but I need help with the selectors on the .toggle() for showing and hiding the INPUTBANNER class. jQuery.fn.inputmenu = function() { function createInputMenu(node) { $(node).bind('focus', function() { ...

How can I improve this JQuery code

Hi, I'm researching the optimising of JQuery code and was wondering if there is a way to better this code as it seems quite long... $("#tabs-nav li a").hover( function(){ if($(this).parent().hasClass('active')) { } else { $(this).stop().animate({ opacity: 1, marginTop: '24px'}, 200); } }, fun...

jQuery button click refresh of jqGrid only firing once

I have the following jQuery code which I'm using to populate a jqGrid. It works perfectly posting to my ASP.NET MVC page on the first click of the button. My problem is, any other clicks past the first it seems to run through the jquery code when clicking the button but it never makes it to the POST page. Any ideas why? <script type="te...

Pass a var to external jQuery

How can I write var menu = $('.something'); and use it in an external .js file like so: $(menu).attr("class", "active"); I have also tried declaring the external js file after the inline code and it will not work. ...

What's the best way to send JavaScript array to PHP script using GET?

I have an interactive web application powered by jQuery where users can manipulate visual objects on the screen. When done, the "state" of JavaScript objects should be sent to PHP to store into database. I'd prefer to use GET for this, but solution that uses POST to submit the data is also viable. I'm currently thinking to serialize al...

JQuery Progress Bar plugin - 100% width

Again I have a question regarding this plugin: http://t.wits.sg/2008/06/20/jquery-progress-bar-11/ What I want to achieve is to set the progressbar's width to 100% so it is as wide as a container it is in. What I have done so far, I have changed this line in the plugin: $bar.css("width",config.width+"px"); To this: $bar.css("width"...

jQuery(document).ready() load() aspx

I am using jQuery 1.3.1 and saying $('#somediv').load('somepage.aspx') An aspx that have a Repeater which loads few images. When loading is complete a cycle() function (jQuery plug-in) will be called upon them. Now I have this working on http://www.techlipse.net/test/agb via the function called from the menu-event-handlers (a combo box)...

Reference JS file in Other JS File and Intellisense

Hi, I've been learning JQuery and I am writing my custom jquery codes in Custom.js file. Actually what I am trying to do is, activate intellisense for Jquery in visual studio but it's not working and I want intellisense to also work in custom.js file where actually I'm writing my custom logic and codes. I thought it could be solved by ...

jQuery - do you know any server file picker/uploader?

Hello there I'm building an application which requires the user to pick an image file from the images folder on the server. What I am looking for is a popup plugin that when clicking the browse button it will show a list of all files in the specified folder and return the filename of the selected file. Additionally (but not mandatory) i...

Resetting a jQuery Accordion

I have two accordions on one page. I would like it so that when one is clicked/activated the other accordion (if opened) will return to its default folded state. I have tried to manually recreate the functionality but it is too buggy and eventually doesn't let me expand accordions. My code: $('#chicago-accordion').accordion({ autoHe...

The Youtube video in my hidden DIV only starts to load after the DIV is shown

I have a Youtube clip in a hidden DIV on my page. After the page has loaded I wanted the video to load quietly in the background so that when the user clicks the button to "un-hide" the DIV, the video will be ready to go. But the way I have it now, the video starts to load only after the user clicks the button. Is there a change I cou...

How can I tell if a CSS file has loaded that I've included via JavaScript?

I have some jQuery that loads a new stylesheet like so $('head').append('<link rel="stylesheet" type="text/css" href="' + config.basePath + config.stylesheetsPath + 'sections/' + name + '.css" media="screen" class="new site-specific" />'); I am then attempting to get some info from that CSS file immediately after. It generally will no...

How to avoid navigate back when the user types backspace on a HTML text input?

Backspace is the browser hotkey for Navigate Back To The Last Page. I know that when an input has the focus this hotkey is disabled. But I have keyup and keydown events binded to this input, and something I wrote is causing this trouble. Do you know the solution? ...

jquery cycle IE7 transparent png problem

I'm having trouble getting jquery cycle to work when I have transparent png files in IE7 It's fine in Firefox and Chrome but in IE (version 7) I get a black colour where the png transparency is during the fade. Can this be made to work right? ...