jquery

Jquery resizing image

I'd like to start a discussion about the image resizing using jQuery. That's my contribution: But I think I'm far away from the solution. What about the cropping? Who can help me? $(document).ready(function() { $('.story-small img').each(function() { var maxWidth = 100; // Max width for the image var maxHeight = 100; // ...

jQuery highlighting selected columns only in a table

Hey all, I see this post on highlighting even columns but can I highlight only selected columns? Here is the code they use: $("table.Table22 > tbody > tr > td:nth-child(even)").css("background","blue"); But I would like: NOTE: the class="highlight" will be on the selected columns, so if I selected column 3 the class="highlight" woul...

applying a datepicker to a mask

I'm new to the javascript and web development scene so bear with me. On a website I'm programming for, I have a table filled with date values from a server side source. Upon clicking a section of a table, the text will be replaced by a input textbox that contains the date that was clicked on(applying a mask) and when the textbox appear...

What is the best Javascript XML-RPC client library?

What is the best Javascript XML-RPC client library in your opinion and why? I'am making a JQuery app and I need to communicate with my xmlrpc server with it. Found following libraries, but I have no idea what are their pros and cons: http://www.zentus.com/js/xmlrpc.js.html http://www.scottandrew.com/xml-rpc/ http://phpxmlrpc.sourcef...

help combining jquery functions in one file

I'm trying to combine a couple of functions on a single js file. I'm very new to jquery, right now I've got the functions working on separate files, being called on diferent pages (working on drupal), but the strings are so small that I thing it would be best to combine them all in the script.js file. Here are the functions: $(document...

jQuery Div parent and child

Hello, Right, lets say I have these repeated divs. <div class="upcoming"> <div class="roll" style="display:none">Hidden</div> </div> <div class="upcoming"> <div class="roll" style="display:none">Hidden</div> </div> <div class="upcoming"> <div class="roll" style="display:none">Hidden</div> </div> This is incorrect, but how do I operat...

How do I change the $ function in jquery for another word for make it compatible with other framworks

How do I change the $ function in jquery for another word for make it compatible with other framworks ...

JavaScript variable scoping - persisting state?

Hi, I have the following setup, and I need to know how to persist state. 1.) An external web page uses ajax to load and display a .jsp file, which contains javascript. 2.) Once this rendering is complete, javascript in the .jsp file must be called to perform an action based on the results that occurred during rendering. Specifically, th...

Using Jquery: Comparing Two Arrays for ANY Match

I'm looking for a concise way to compare two arrays for any match. I am using this comparison to apply a particular style to any table cell that has matching content. One array is a static list of content that should be contained in at least one table cell on the page. The other array is being generated by JQuery, and is the text of al...

JS: Get clipboard data

I'm trying to write a Javascript function to edit content from clipboard before pasting. Right now i got bound event 'paste' to function via JQuery. $(this.elementDoc).bind('paste', function(event){ self.OnPaste(event); }); But that's not important. Now i would like to get Data from clipboard, but i can't find out how. I would be g...

How can I tell if a jQuery node is at the beginning of its parent node?

Given the following HTML: <p><img id="one" alt="at beginning, return true" />Some Text</p> <p>Some <img id="two" alt="in middle, return false" />Text</p> <p>Some Text<img id="three" alt="at end, return false" /></p> How would I be able to tell that $("img#one") is at the beginning of its parent node? Ideally what I'm trying to do is ...

jquery selectors for plain javascript objects instead of DOM elements

I've just started using jquery and I'm really enjoying using selectors. It occurs to me that the idiom would be a very nice way to traverse object trees (e.g., JSON query results). For example, if I have an object like this: var obj = { 'foo': 1, 'bar': 2, 'child': { 'baz': [3, 4, 5] } }; I would love to be able ...

asp.net JQuery .hover event gives out "object expected" error

This is what I have On my .master page i have the following <script type="text/javascript"> $(document).ready(function() { $(this).hover(function() { $(this).addClass("ui-state-hover"); }, function() { $(this).removeClass("ui-state-hover"); } ).mousedown(function() { $(this).addClass("ui-state-active"); ...

jQuery table row builder

There is a maintanble approach to build DOM with jQuery? Take a look at the append method of this code... $.getJSON("api/test", function(data) { $.each(data, function () { $("#tests").append($('<tr><td><input type="radio" name="' + this["name"] + '"/><td>' + this["name"] + '</td><td>' + this["descr"] + '</td></tr>')); }...

jQuery smooth change of innerHTML

I have the code below working like a charm: var div = $('#div'); div.html('<div>one line</div><div>another line</div>'); div.slideDown('slow'); But the problem comes when I need to change the content (the number of lines): div.html('<div>one line replacement</div><div>another line replacement</div><div>third line</div>') This trans...

Best way to store a key=>value array in Javascript?

What's the best way to store a key=>value array in javascript, and how can that be looped through? The key of each element should be a tag, such as {id} or just id and the value should be the numerical value of the id. It should either be the element of an existing javascript class, or be a global variable which could easily be referen...

How to handle error from MVC controller on JqGrid inline editing.

onSelectRow: function(id) { if (id && id !== lastsel<%= count %>) { $j(gridName).restoreRow(lastsel<%= count %>); $j(gridName).editRow(id, true); lastsel<%= count %> = id; ...

Modifying GridView data using Jquery doesn't persist back to Server events

Hi, So i have an ASP.NET GridView control in which each column is a 'BoundField'. I did not create a TemplateField(ItemTemplate/EditItemTemplate), because i was planning on using JQuery to convert the BoundField row to a 'Edit' field by just converting the text in each cell to a textbox or textarea when that row was clicked. This is done...

How do I scroll to the top of the page with jQuery?

I have a button a user presses and it shows a hidden div using jQuery. My question is, how do I scroll to the top of the page using a jQuery command in that function? It is desirable if the scroll bar instantly jumps to the top. I'm not looking for a smooth scrolling. ...

Hold Twitter script from loading until all other scripts have been processed

jQuery, Cufon, fonts, jQuery plugins, and JavaScript code, are at the top of a page. The Javascript code is all wrapped in a document.ready(). Two Twitter scripts, one the actual script and one the JSON, are at the beginning. A problem that is going on is that I have found out that even placing the scripts at the bottom of the page, Twi...