jquery

Dragging HTML cells over the table using Javascript

Folks, I need a solution that allows drag-and-drop cell over the table. The cells can be of different colspans, so when the cell is dropped into the middle of another cell, which is bigger, the following steps should be performed: Another td element is created, which is equal in width to the draggable element. Cells on left and righ...

What is the best back button jQuery plugin?

I have found two plugins that enable the browser's back button to work across ajax interactions, but I can't determine which is better and why. The two plugins are history_remote and the history. The history plug in is simpler and seems to provide all the functionality I need, but I'm not sure I understand enough about them to make a...

How to correctly add a <select> to a page with jquery and let the change event work?

I've currently got multiple select's on a page that are added dynamically with ajax calls using jquery. The problem I've had is I could not get the change event to work on the added select unless I use the onchange inside the tag e.g. <select id="Size" size="1" onchange="onChange(this);"> This works, but I'm wondering if there's a w...

How can I bind an event handler to an instance in JQuery

I am trying to bind an event to a "method" of a particular instance of a Javascript "class" using JQuery. The requirement is that I in the event handler should be able to use the "this" keyword to refer to the instance I originally bound the event to. In more detail, say I have a "class" as follows: function Car(owner) { this.owner =...

jquery: fastest DOM insertion ?

I got this bad feeling about how I insert larger amounts of HTML. Lets assume we got: var html="<table>..<a-lot-of-other-tags />..</table>" and I want to put this into $("#mydiv") previously I did something like var html_obj = $(html); $("#mydiv").append(html_obj); Is it correct that jQuery is parsing html to create DOM-Objects ? ...

Trying to resize a jQuery dialog in IE6?

I thought I had seen a bug report about this on the jQuery site, but now I cannot find it. I'm trying to resize a dialog in IE6. But when the element is resized, the content and title bar don't resize down. They will resize up if the dialog is made larger, however. The result is that the close button ends up being cut off and the content...

Highlight a word with jQuery

I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text: <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </p> <p> Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero. Aliquam rhoncus eros at augue. Suspendisse vitae...

How can I get jQuery unclick() and unbind() to work?

I want to attach an click event to a button element and then later remove it, but I can't get unclick() or unbind() to do anything. In this example below, the button is tan and the click event works. window.onload = init; function init() { $("#startButton").css('background-color', 'beige').click(process_click); $("#startButton"...

How to use javascript with an asp.net dropdownlist control?

I don't currently use ajax.net though I would be open to it if it is the only solution. I have a auto-complete control on screen that I am using to populate a asp.net dropdownlist with values through javascript (jQuery). I have had to use EnableEventValidation="false" to allow this. After I add my options to the select and the form is po...

Hidden (or not widely known) features of jQuery

What are the hidden features of jQuery? See also: Hidden features of javascript ...

What is the most efficient way to clone a JavaScript object?

What is the most efficient way to clone a JavaScript object? I've seen: obj = eval(uneval(o)); but that's not cross platform (FF only). I've done (in Mootools 1.2) things like this: obj = JSON.decode(JSON.encode(o)); but question the efficiency. I've also seen recursive copying function, etc. I'm pretty surprised that out-of-the-bo...

What are some of the pros and cons of using jQuery?

As someone who is only barely proficient in javascript, is jQuery right for me? Is there a better library to use? I've seen lots of posts related to jQuery and it seems to be the most effective way to incorporate javascript into ASP.NET applications. I've been out to jQuery's site and have found the tutorials and other helpful informa...

jQuery onClick execution

I have this bit of javascript written with jQuery 1.2.5. It's contained inside the main function() of a plugin that I wrote. The plugin is a horizontal gallery scroller very similar to jCarousel. It does alot of auto calculating of widths and determines how many to scroll based on that and the size of the images, which is what all the...

How to line up items of varied length in a resizable space in CSS?

I'd like to line up items approximately like this: item1 item2 i3 longitemname i4 longitemname2 anotheritem i5 Basically items of varying length arranged in a table like structure. The tricky part is the container for these can vary in size and I'd like to fit as many as I can in each row - in other...

Using JQuery to find the next table row

Using JQuery, how do you bind a click event to a table cell (below, class="expand") that will change the image src (which is in the clicked cell - original will be plus.gif, alternating with minus.gif) and hide/show the row immediately below it based on whether that row has a class of "hide". (show it if it has a class of "hide" and hide...

Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators?

Can you have custom client-side javascript Validation for standard ASP.NET Web Form Validators? For instance use a asp:RequiredFieldValidator leave the server side code alone but implement your own client notification using jQuery to highlight the field or background color for example. ...

Adding New Element to Text Substring

Say I have the following string: "I am the most foo h4ck3r ever!!" I'm trying to write a makeSpecial(foo) function where the foo substring would be wrapped in a new span element, resulting in: "I am the most <span class="special">foo></span> h4ck3r ever!!" BeautifulSoup seemed like the way to go, but I haven't been able to make it ...

How to implement unobtrusive javascript with dynamic content generation?

Hey, I write a lot of dynamically generated content ( developing under PHP ) and I use jQuery to add extra flexibility and functionality to my projects. Thing is that it's rather hard to add JavaScript in an unobtrusive manner. Here's an example: You have to generate a random number of DIV elements each with different functionality tr...

Best way to register js for modularity in User Control

Hello i have a control that is organized like this and i want to have the javascript registered on the calling master pages, etc, so that anywhere this control folder is dropped and then registered, it will know how to find the URL to the js. Here is what i have so far (in the user control ) protected void Page_Load(object sender, ...

jQuery $().find problem

I'm trying to get the contents of a XML document element, but the element has a colon in it's name. This line works for every element but the ones with a colon in the name: $(this).find("geo:lat").text(); I assume that the colon needs escaping. How do I fix this? ...