jquery

JQuery: show div on radiobutton select

Hi, I am trying to use JQuery to show a div when the user selects a particular radio button (Other) within a radiobutton group. The html is below <div id="countries"> <input id="Washington_D.C" TYPE="RADIO" NAME="location" VALUE="Washington">Washington D.C</input> <input id="Other" TYPE="RADIO" NAME="location" VALUE="">Other</input> ...

Cancel draggable dragging

I have a draggable (jquery-ui) element. How can I cancel current draggig based on some constraints? In other words, I want to constraint possible moves of this draggable element, but it is more complicated then based only on axis or parent (containment). How can I do that? ...

How to drag items between 2 sorted lists with jQuery?

Hi - I'm trying to implement drag/drop/sort between 2 list elements: <ul id="first"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> <ul id="second"> <li>item 4</li> <li>item 5</li> <li>item 6</li> </ul> Basically I just want to be able to pass items between the lists and sort the items in each list. What's the simp...

.ajax not being invoked

I've got a javascript function I created. Somewhere in that function, this line is called: var divContent = getDataAsyncHtml(dialogDiv.attr("winHref")); I'm not sure why the .ajax is not being invoked once it hits my getDataAsyncHtml function. Do I need a function() ? function getDataAsynHtml(urlWithContent) { alert("urlWithCon...

What's faster DOM Insertion or Manipulation?

Hi all, Am I better to move a node I sent down form the server or to insert it? I'm using jQuery (1.4) but would like to know for both jQuery and JS in general. In this case the node is small with only one child. But what if it were a large list? What large list 1 = 200 li nodes large list 2 = 1000 li nodes Example: Insertion: <d...

How to populate a dropdownlist with json data in jquery?

I am developing a country state cascading dropdown list... I returned json result based on countryId but i dont know how to populate/fill it in a new dropdown listbox... Here is what i am using, function getstate(countryId) { $.ajax({ type: "POST", url: "Reg_Form.aspx/Getstates", data: "{'countryId':" + (cou...

Jquery galleria - make the first image in the gallery appear automatically

I've added the excellent galleria-plugin to a website I'm working on. However unlike the demo, I've been unable to make the first image display automatically on page-load. Currently, you have to click an image, before one will appear, after that everything works as expected. And yes, I've tried setting the class of the first image to "a...

Returning the html from .ajax call

I'm getting undefined for some reason when I try to return the html via the callback function: function getDataFromUrl(urlWithContent) { // jQuery async request $.ajax( { url: urlWithContent, dataType: "html", success: function(data) { return $('.result').html(dat...

how to load external content in a div and then display it in a lightbox using jquery?

how to load external content in a div and then display it in a lightbox using jquery? Thanks ...

Stop then restart submit() after ajax check

I asked a question [here] recently and it's just not providing me with an answer. Here's what I want to do and you can see my first attempt at the link above: User submits form Stop default submit action check to see if a similar entry exists in database If it does, display a notice asking them if they want to submit anyway and give ...

Send 3 text box values to a server-side method with jQuery ajax

Hi, I want to send three text box values to server using jquery ajax. problem is that, i dont know the exact syntax to send three data. When i try sending one data(also change no.of parameters to one at server side method), its going good but when i try to send three text box values, its giving jquery error:"Internal server error". I thi...

how to loop all rows in jquery grid

I have this code right now to get the row value from jquery grid.. $("#table1").click(function(e) { var row = jQuery(e.target).parent(); value = row.attr("id"); i need to loop all the rows to get the values cany anyone help me out.. that is if I click on second row I need get second row value if I clic...

Jquery Event onChange for Div

I have a page with the following two divs: <div id="searchResults"> </div> <div class="postSearchOptions" style="display: none;"> </div> Is there any way that I can make the "postSearchOptions" div appear when the "searchResults" div is updated by an AJAX call? I don't control the AJAX calls and I want to detect any change in the "se...

External js file jquery function doesn't seem to get clientId....

I use an externel javascript file and i have this, function getdropdownvalue() { alert($("#<%=DLState.ClientID%>")); } but it doesn't seem to get my dropdown's clientId... Any suggestion... ...

IE 7 can't bind event (using .live()) to dynamically created element using .load()

Hi All - I'm having trouble getting IE7 to keep a click event bound to an element that is added to the DOM using .load(). Here's some code: $('.mybtn').live('click', function(e){ e.preventDefault(); $('#mypage').load('load-this-page.htm'); }); And here's the html <div id="mypage"> <a href="#" class="mybtn">clickme</a> /...

Tabs taking be to top of page

I have set up tabbing but when I click on a tab it shows the tabbed content, but it also takes me to the top of the page, which I don't want it to. Here is my code... $('.team-tab1').click(function() { $('#team-tab2-content,#team-tab3-content').css('display', 'none'); $('#team-tab1-content').fadeIn(); ...

cant get jquery hover to work with .live()

the second function isnt working? $('.edit_hover').live('hover', function(e){ $(this).stop(); var half_width = ($(this).css('width').slice(0, -2))/2; var half_height = ($(this).css('height').slice(0, -2))*0.3; console.log(half_width); var top = ($(this).position().top) + half_height; ...

jquery div container that updates from mysql every 5 min

Can anyone please tell me how to write a small div container in HTML that refreshes its contents from the data in mysql every 5 min. This is similar to twitter updates in some webpages which show updates as and when tweeted. Thanks. ...

I tried to prototype a length() method to Object and broke jQuery – how?

I wrote the following: Object.prototype.length = function(){ var count = -1; for(var i in this) count++; return count; } It works. But when I execute my page, even without using this function, Firebug tells me that jQuery's .appendTo() is no longer a function. Why would this be? ...

jQuery image fader slow in IE6 & 7

Hi guys, I'm using the following jQuery script to rotate through a series of images pulled into an unordered list using PHP: function theRotator() { $('#rotator li').css({opacity: 0.0}); $('#rotator li:first').css({opacity: 1.0}); setInterval('rotate()',5000); }; function rotate() { var current = ($('#rotator li.show')...