jquery

jQuery draggable text selection bug

I am not sure if this is a bug - but in this example there is no way to select the text underneath the elements that can be dragged. Same issue with form elements. http://jqueryui.com/demos/draggable/handle.html Any ideas? ...

jquery hasClass "active" on ul#navigation li on page load not working

$(document).ready(function(){ $("li").click(function(){ if ($(this).hasClass("active") ) $(this).fadeTo("slow", 1.0); }); }); I have a navigation bar made and am using this code to add a transparency effect on hover: $(document).ready(function(){ $(".thumbs").fadeTo("slow", 0.6); $(".thumbs").hover(function(...

Tracking submissions of a form which doesn't submit anywhere

I have an overlay with form (just a radio button group with 3 buttons and a submit button) that, on submit, uses jQuery to open a specific file (a PDF) in a new tab and then close the overlay. The file depends on which button was selected. The problem: the form doesn't actually submit so I don't know how to track submissions, and the cli...

Getting the index of a list item with Jquery

I'm trying to find out the index number of the last list item but the jquery I'm using keeps returning -1. This is the JS and the html that I'm using. var index = $('#imageThumbnails li:last').index(this); <div id="imageThumbnails"> <ul class="gallery_demo_unstyled"> <li class="active"><img src="test-img.jpg" width="394" heigh...

How can i get Jquery UI datepicker to show up in asp.net gridview edit field

I have a gridview inside an update panel, that is doing inline editing. When edit is clicked, I need on of the textboxes to be a Jquery UI datepicker; I've tried class and id selectors, tried child selector but Jquery can't set the thing as a datepicker because the element isn't really on the page yet. So I tried adding a function to ...

Rearrangeable DIVs in javascript (jQuery plugins)

Anyone knows how i can implement re-arrangable divs (Drag the divs around on the page, but divs should not be overlapped, something like igoogle widgets). I was trying to see if i can find any jQuery plugins available, but couldnt find any. thanks ...

How can I make jQuery's draggable function expand the container?

If I have markup like this: <!-- Other Content --> <div id="container"> <div class="draggable"> </div> <div class="draggable"> </div> </div> <!-- Other Content --> How can I have the container div expand vertically (I only want #container to be capable of expanding downward) as I drag one of the draggables? I've thought about using t...

jqGrid editing ONLY through form mode

Hi In my grids on the page, all of them need to not only have inline edit disabled, but ALSO should be editable via the modal form ONLY. However, turning editable : false, while preventing in-line edits, also prevents editing via the form (no columns can be seen on the form, just the Submit and Cancel buttons) How can I effect this be...

What's the best way to avoid code duplication in these two functions that do the same thing?

Given this form (which contains a submit button): <form id="review_form"> <input type="submit" id="btn_submit" value="Submit with ajax! (submit button)"> </form> and this link (to submit the same form): <a href="#" id="lnk_submit">Submit with ajax! (hyperlink)</a> In the following jQuery code, when the #btn_submit element is clic...

less verbose way to chain jquery events that have to wait for animations?

Chaining is great in jQuery, but it chains the trigger of each event and doesn't wait for the previous event to finish. This is noticeable primarily when animating. As such, the workaround I've seen is to use call back functions. The only drawback is if, say, you have 4 things that you want to animate in succession. Admittedly, this is...

Using the Perl module JSON to create a JSON object

I'm having a killer time trying to create a JSON object to return to a jQuery request. I'm trying to use the jQuery chained select module and I'm trying to create the JSDN object using Perl's JSON module. I have no idea what I'm doing wrong or how I can even debug it, about the best I can do is get a JS dialog box coming up with "A un...

How to help the debugger see my javascript, or how to best refactor my script to help make it debugger-friendly?

I have an ASP.NET MVC project that uses some simple AJAX functionality through jQuery's $.get method like so: $.get(myUrl, null, function(result) { $('#myselector').html(result); }); The amount of content is relatively low here -- usually a single div with a short blurb of text. Sometimes, however, I am also injecting some javasc...

I can add an overlay, but I can't remove it (jQuery).

This function adds an overlay with the following properties to the entire browser screen, $('a.cell').click(function() { $('<div id = "overlay" />').appendTo('body').fadeIn("slow"); }); #overlay { background-color: black; width: 100%; height: 100%; position: fixed; top: 0; left: 0; display: none; z-index: 100; opacity: 0.5; } And...

Why can't I use focus() to place a cursor inside of a text field outside of Firefox?

I'm using this line of code: $(":text:visible:enabled:first").focus(); It works in Firefox but not in Chrome, IE8, IE7, or Safari. I would ideally like to place the cursor in a text field at a form so that one may just starting typing in the field without having to navigate to it with a mouse. ...

jquery focus, but with more accurate postion.

you can easily find focus() answers from the site or any site.. but what i want to know, how can i use focus after what i just inserted inside the input box. $("input").val('@user').focus(); // this goes to start of the input box and foucs from start, but i want it to focus after the @user $("input").val('@user today i did new things')...

determining $(this) in jquery

A common issue I have is getting confused what $(this) is referring to. I often will try to give it some odd style: $(this).css("border","10px solid red") Which helps sometimes. I'm stumped with the following however. My question can maybe be answered in two ways: 1) is there a universal way to 'see' what $(this) is referring to in...

jquery documentready

hi guys I wanted to know, is there a way to not display my webs content scattered before the jquery document ready is finished? I saw it on a site somewhere and I cannot find it now, forgot to bookmark the site. Does anyone have a clue? ...

JQuery Removing all , except matched rows

Hi All, I am trying to remove all the rows from a table EXCEPT the matched rows: This code removes the rows that I in fact want to keep - $("table#traffic").each(function() { $("td:contains('" + selected_text + "')").parent().remove(); }); I basically want to do the opposite of the above. ...

Delaying dropdown - settimeout

I am using jquery to create a custom dropdown with the code below. I have tried a jquery timeout effect that almost worked, its uses was like .idle(500); The method I have below, drops ALL the menus down at once. Compared to not using the timeout and the nested ishowmenu function. Any ideas on what I can do? When using the idle(), it...

JQuery cycle plugin + PNG overlay + Image alt text as title conflict

Hello I am trying to achive the following: Create an image gallery using the JQuery Cycle plugin that shows images with titles (taken from the alt text) Each image has a PNG absolutley posiioned over the top to achieve rounded corners effect Here's my gallery HTML: <div id="slideshow" class="pics"> <div class="photo-container" > <...