Search Results

Search found 23364 results on 935 pages for 'jquery ui droppable'.

Page 69/935 | < Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >

  • jQuery autosuggest example

    - by RUtt
    I need to implement an "autosuggest" feature on our site but it needs to re-query the on every keystroke after a certain number of keys (like every character after 2 it would need to query again). So the result isn't a limiting search. For example, the autocomplete plugins I've seen work like the following: [looking for a county] 1. customer types 'CA' and the first result would return 'Canada', 'Cambodia', and 'Camaroon' 2. customer continues to type and hits 'M' the new results would query within the only the existing 3 results (producing results of just 'Cambodia' and 'Camaroon') I need a solution that would be the equivalent of querying my datasource on each keystroke. I already have the ajax call that will return my results based on the "typed" params. For example (in the above example), it would need to make an ajax call passing 'ca' first and if the customer kept typing passing 'can' on the 3 character and so forth. Thanks.

    Read the article

  • JQuery SelectList Option Changed doesn't refresh

    - by Jean-Philippe
    Hi. I have this select list: <select url="/Admin/SubCategories" name="TopParentId" id="ParentList"> <option value="">Please select a parent category</option> <option value="1" selected="selected">New Store</option> <option value="2">Extensions</option> <option value="3">Remodel</option> <option value="4">Bespoke Signage</option> <option value="5">Tactical Signage</option> <option value="6">Size Chart</option> <option value="7">Contact Info</option> </select> As you can see the option 1 is marked as selected. When I change the selection, I use this code to do an ajax call to get some values to populate a new select list: $("#ParentList").unbind("change"); $("#ParentList").change(function() { var itemId = $(this).val(); var url = $(this).attr("url"); var options; $.getJSON(url, itemId, function(data) { var defaultoption = '<option value="0">Please select a sub-category</option>'; options += defaultoption; $.each(data, function(index, optionData) { var option = '<option value="' + optionData.valueOf + '">' + optionData.Text + '</option>'; options += option; }); $("#SubParentList").html(options); }); }); My problem is that whenever I change the selection, the itemId is always the id of option 1, because it is marked as selected. It doesn't pick up the value of the option it is being changed too. Can someone please enlighten me of their knowledge. Regards, Jean-Philippe

    Read the article

  • Partial slideDown with jQuery

    - by Jon
    I have some buttons that have drawer menus and what I'd like to do is add a state so that when the user hovers over the button, the drawer bumps out slightly (maybe with a little wiggle/rubber-banding) so that they know that there's a drawer with more information. I have the sliding working and a hover function set up, but I don't know how to implement a partial slideDown. Any ideas? FIDDLE. Code: <div class="clause"> <div class="icon"><img src="http://i.imgur.com/rTu40.png"/></div> <div class="label">Location</div> <div class="info">Midwest > Indiana, Kentucky; Southwest > Texas, Nevada, Utah; Pacific > California, Hawaii</div> </div> <div class="drawer">Info 1<br/><br/></div> <div class="drawerBottom"></div> $(".clause").click(function() { var tmp = $(this).next("div.drawer"); if(tmp.is(":hidden")) tmp.slideDown('3s'); else tmp.slideUp('3s'); }); $(".clause").hover(function() { });

    Read the article

  • jQuery text attribute selector

    - by Shagglez
    I am trying to use the text attribute as a selector, but I can't quite grasp the behaviour, would really appreciate if someone could explain. For example given <span class="span_class"><a class="a_class">text</a></span>, $('a.a_class').text() gives "text" as expected. However $('a.a_class[text]') wouldn't match any elements, and neither would $('span.span_class > a.a_class[text]'), but $('span.span_class* > a.a_class[text]') would (although not in IE). The only workaround I can think of for IE, is loop through all anchors contained in a span, use .text() on each and match it against a certain criteria, but it seems slower than using in-built selectors. Anyone have better ideas?

    Read the article

  • JQuery Animate.

    - by Oliver
    Hi Really easy, I'm sure... I have a div which is the full screen and I want it to slide down from the top to the bottom. I have this: $('#full-screen').animate({ "bottom":0, height: 'toggle' }, 1000, function() { // Animation complete. }); But this is the wrong way round as the bottom moves up; how do I get the bottom to stay where is is and the top to slide down to meet it? Thanks

    Read the article

  • jQuery validate plugin radio with optional text

    - by timborden
    I'm trying to figure out how to validate a form element with a mix of radio inputs and a text input: <label>Question?</label> <input type="radio" class="mandatory" name="questions[1][]" value="1" />answer 1<br/> <input type="radio" class="mandatory" name="questions[1][]" value="2" />answer 2<br/> <input class="ignore" type="radio" id="questions[1][]" />Other (please specify)<br/> <input class="optional mandatory" type="text" name="questions[1][]" value="" /> I've figured out how to get the form to behave as expected (select and unselect) with the following code: $("input.optional").focus(function () { var this_name = $(this).attr("name"); $("input:radio").filter(function() {return $(this).attr('name') == this_name; }).attr('checked', false); $("input").filter(function() {return $(this).attr('id') == this_name; }).attr('checked', true); }); $(':radio').click(function () { var this_name = $(this).attr("name"); $("input").filter(function() {return $(this).attr('id') == this_name; }).attr('checked', false); $("input.optional").filter(function() {return $(this).attr('name') == this_name; }).val(''); }); I was hoping I could use the class "mandatory" to validate the mix of radio and text inputs: $("form .manditory").each(function () { $(this).rules("add", {required: true}); }); But it's not working as expected. With the radio (id="questions[1][]") selected, and the text input containing content, the form element is still flagged as invalid. Suggestions...maybe a better approach? Thanks in advance. UPDATE Sorry, I should have clarified that I'm using the validate plugin: $("form").validate({ ... });

    Read the article

  • jQuery - search for previous selector relative to current

    - by Thomas Slater
    I have a form with 3 sections in it. Each section has a dedicated div for fairly long contextual help messages regarding the input that has focus. My question is, if I give each of these help divs a class of "form-tip" and each input that has a tip the class "has-tip", how can I get the tip to always show up in the previous "form-tip" div? Something like: $('.has-tip').each(focus(function() { var tip = $(this).attr('title'); // Find most recent $('.form-tip') in the DOM and populate it with tip })); I hope that makes sense... Thanks for any help.

    Read the article

  • jquery animating different img widths

    - by romeozor
    Hi there, I've been searching for an answer for a long time with no avail, so it's time to ask. I'm trying to use .animate() to change the size of an image once clicked. The first state of the image would be a thumbnail size, which would animate to the image's original size, then to a thumbnail again. The problem is, not all the images have the same "original" size so I need a way to tell one generic function to switch to the current image's original size. This is my current code which loads on $(window).load: $('img[class=resize]').click(function (){ if ($(this).width() != 150) { $(this).animate({width: '150px'}, 400); } else { $(this).animate({width: ''}, 400); } }); Now this obviously doesn't work the way I want it, because .animate() thinks when I say width: '' I want to make the width = 0. Any suggestions how I should go about this?

    Read the article

  • JQuery Load() syntax - Changing data source on mouseenter

    - by Andrew Parisi
    Hey everyone. I've written this simple function that is supposed to load a portion of an XML file on mouseenter. It works fine when I specify the data source explicitly, shown below. I have a number of '.invest-port-thumb' divs, each with a unique link. The following code works fine—but it loads the whole XML file—and I only want a portion: $(document).ready(function() { $('.invest-port-thumb a').mouseenter(function() { $('#slider-name').load(this.href); }); }); This code also works fine—loading only the 'cName' portion that I want it to load...Except that this code refers to one of the files, instead of the value of this.href. $(document).ready(function() { $('.invest-port-thumb a').mouseenter(function() { $('#slider-name').load('port/atd.xml cName'); }); }); I guess what I'm saying, syntax wise—How can I combine this.href and the data matching cName? Thanks for the help!

    Read the article

  • jQuery indexOf select box manipulation

    - by kenny99
    Hi, I'm trying to figure out how to remove options from a select box when that option has been selected in an adjacent select box. Basically the user has the option to add multiple records here via select boxes, but I want to remove the list of options available to them so that, for example, they can't enter the same value in two select boxes. When an Add More button is clicked, I fade in the next select box container. A number of select boxes have been generated by PHP and I use JS to hide them. Each select box has a unique number appended to the ID, so i want to access those select boxes which contain the string "other_pet_types", then I want to iterate through the currently visible ones and build an array of the values which have been selected, which I will then remove from the list of options in the newly displayed select box. This is what I have so far, but it's definitely not right - I can't get the initial test on the ID to work. Any pointers greatly appreciated as i realise i'm pretty wide of the mark at the moment! var vals = new Array(); //build array with currently selected options $('p.mult_entries select').each(function(){ vals += $(this).val(); }); $("p.mult_entries:hidden:first").fadeIn("slow", function() { $(this).find(('select').attr('id').indexOf('other_pet_types') > 0).each(function(){ console.log($(this).val()); //as expected prints nothing - need to iterate through the options of the above select //once i extract the correct values, iterate through new select box and use inArray to remove options where that value already exists in one of previous select boxes }); });

    Read the article

  • Jquery nested div .click event

    - by Sylph
    The link #loadContent will loads tree.html. Upon success loading the content, the script reinitialize some functions which is in tree.html. However, I am unable to get the .click event to function in the loaded content. Index.html <a href="#" id="loadContent">Load</a> <script type="text/javascript"> $(function() { $("#loadContent").click(function() { $.ajax({ url: "tree.html" ,success: function(data) { $('#result').html(data); $("#demo_1").tree({ rules : { use_max_children : false, use_max_depth : false }, callback : { onmove : function (NODE,REF_NODE,TYPE,TREE_OBJ,RB) { alert(TREE_OBJ.get_text(NODE) + " " + TYPE + " " + TREE_OBJ.get_text(REF_NODE)); } } }); } }); }); }); </script> <script type="text/javascript" class="source"> $(function () { $.tree.drag_start = function () { $("#log").append("<br />Drag start "); }; $.tree.drag = function () { $("#log").append(" ."); }; $.tree.drag_end = function () { $("#log").append(" Drag end<br />"); }; $("#demo_1").tree({ rules : { use_max_children : false, use_max_depth : false }, callback : { onmove : function (NODE,REF_NODE,TYPE,TREE_OBJ,RB) { alert(TREE_OBJ.get_text(NODE) + " " + TYPE + " " + TREE_OBJ.get_text(REF_NODE)); } } }); $("#demo_2").tree({ rules : { use_max_children : false, use_max_depth : false }, callback : { onmove : function (NODE,REF_NODE,TYPE,TREE_OBJ,RB) { alert(TREE_OBJ.get_text(NODE) + " " + TYPE + " " + TREE_OBJ.get_text(REF_NODE)); } } }); }); </script> <div class="demo" id="demo_2"> <ul> <li id="phtml_1" class="open"><a href="#"><ins>&nbsp;</ins>Root node 1</a> <ul> <li id="phtml_2"><a href="#"><ins>&nbsp;</ins>Child node 1</a></li> <li id="phtml_3"><a href="#"><ins>&nbsp;</ins>Child node 2</a></li> <li id="phtml_4"><a href="#"><ins>&nbsp;</ins>Some other child node with longer text</a></li> </ul> </li> <li id="phtml_5"><a href="#"><ins>&nbsp;</ins>Root node 2</a></li> </ul> </div> <div id="result"></div><br> <div id="log"></div> Tree.html <div class="demo" id="demo_1"> <ul> <li id="phtml_1" class="open"><a href="#"><ins>&nbsp;</ins>Root node 1</a> <ul> <li id="phtml_2"><a href="#"><ins>&nbsp;</ins>Child node 1</a></li> <li id="phtml_3"><a href="#"><ins>&nbsp;</ins>Child node 2</a></li> <li id="phtml_4"><a href="#"><ins>&nbsp;</ins>Some other child node with longer text</a></li> </ul> </li> <li id="phtml_5"><a href="#"><ins>&nbsp;</ins>Root node 2</a></li> <li><a class="preset_text" id="1">model 1</a> </li> <li><a class="preset_text" id="2">model 2</a></li> </ul> </div> <script type="text/javascript"> $(document).ready(function() { $('.preset_text').click(function(){ var target = $(this).attr("id"); alert(target); }); }); </script> In tree.html, I am unable to get the alert(target). However, If I moved this section out from the "div #demo_1" in tree.html, I am able to receive alert(target). <a class="preset_text" id="1">model 1</a> <a class="preset_text" id="2">model 2</a> How can I get to detect the item clicked in the div demo_1 ? Thanks

    Read the article

  • JQuery click anywhere except certain divs and issues with dynamically added html

    - by jCuga
    I want this webpage to highlight certain elements when you click on one of them, but if you click anywhere else on the page, then all of these elements should no longer be highlighted. I accomplished this task by the following, and it works just fine except for one thing (described below): $(document).click(function() { // Do stuff when clicking anywhere but on elements of class suggestion_box $(".suggestion_box").css('background-color', '#FFFFFF'); }); $(".suggestion_box").click(function() { // means you clicked on an object belonging to class suggestion_box return false; }); // the code for handling onclicks for each element function clickSuggestion() { // remove all highlighting $(".suggestion_box").css('background-color', '#FFFFFF'); // then highlight only a specific item $("div[name=" + arguments[0] + "]").css('background-color', '#CCFFCC'); } This way of enforcing the highlighting of elements works fine until I add more html to the page without having a new page load. This is done by .append() and .prepend() What I suspected from debugging was that the page is not "aware" of the new elements that were added to the page dynamically. Despite the new, dynamically added elements having the appropriate class names/IDs/names/onclicks ect, they never get highlighted like the rest of the elements (which continue to work fine the entire time). I was wondering if a possible reason for why my approach does not work for the dynamically added content is that the page is not able to recognize the elements that were not present during the pageload. And if this is a possibility, then is there a way to reconcile this without a pageload? If this line of reasoning is wrong, then the code I have above is probably not enough to show what's wrong with my webpage. But I'm really just interested in whether or not this line of thought is a possibility.

    Read the article

  • Jquery ajax POST label/value pair

    - by aus_fas
    I want to pass label/value pair in Ajax .POST but cannot find any solution. Any help please. $.ajax({ url:"allfields.php", type:"POST", // dataType:"json", data: $("#frmRequest").serialize(), success: function(msg){ alert("Form Submitted: "+ msg); return msg; }, error: function() { alert('Error occured'); } });

    Read the article

  • jquery selecting sibling node of the current node

    - by priyank.mp
    How do I select sibling node of the current node? Here is the snippet: <div id="main"> <a class="test" href="test.html">Hello</a> <div>Some text</div> </div> //script $(".test").click(function() { $("this:parent > div").toggle(); }); or $(".test").click(function() { $("this ~ div").toggle(); }); None of these works. I know I can access current object using $(this) but in this case I don't know how.

    Read the article

  • jQuery - how to pass $(this) as an object?

    - by regan
    Hello! I'm trying to pass an object into a function but think there's a problem with $(this) not actually being valid at the point of passing it in. $('textarea#quote').live('bind',function(){ }).limit('10',$(this).parents('form').children().find('span#qc') ); The second parameter can be either a string or an object like $('span#qc'), but I also want to be able to pass in an object which references the current one. Why? Because I have several forms on same page, each containing textarea#quote, so depending on which form is selected I want to be able to reference a particular element within the same form. Anyone??

    Read the article

  • JQuery - which form was submitted?

    - by OneMostFrustratedChap
    Hello, I have a page of products and for each of them, I want to have a form that uses AJAX to update the session. I've done this bit - just providing background. I use the product's ID to create a different form class and name for each form, so each form is called something like this_form_name_567 and the next would be this_form_name_568 and so on. There is a submit button per form. I'm having trouble figuring out a) which event is best to use so that the correct form will be identified when a submit button is clicked, b) once clicked, how to then make sure the correct value is taken from a hidden field (unique ID) within the submitted form so that I can populate a line of code such as: $.post("compare_response.php", {compare_this: $("#compare_this").val()}, function(data){ } Any help would be greatly appreciated. Thank you

    Read the article

  • Jquery multiple events to trigger the same function

    - by dweebsonduty
    Is there a way to have keyup, keypress, blur, and change events call the same function in one line or do I have to do them separately? The problem I have is that I need to validate some data with a db lookup and would like to make sure that there is no way that the validation is missed weather it is typed or pasted into the box.

    Read the article

  • jQuery toggle div and text

    - by Jack
    I would like some help with this code, I have read similar questions & answers here on stackoverflow but I still can't get it right. I have a link that populated by .html("") to read more… when clicked it opens the hidden div and at the end the .html("") reads less. When I click close the div slides closed but the text still reads less… I have read many articles on how to do this but am confused and can't get past this last hurdle, any help would be much appreciated. // this is the intro div Ligula suspendisse nulla pretium, rhoncus tempor placerat fermentum, enim integer ad vestibulum volutpat. Nisl rhoncus turpis est, vel elit, congue wisi enim nunc ultricies sit, magna tincidunt. Maecenas aliquam maecenas ligula nostra, accumsan taciti. // this next div is hidden Ligula suspendisse nulla pretium, rhoncus tempor placerat fermentum, enim integer ad vestibulum volutpat. Nisl rhoncus turpis est, vel elit, congue wisi enim nunc ultricies sit, magna tincidunt. Maecenas aliquam maecenas ligula nostra, accumsan taciti. $(document).ready(function() { $(".overview-continued").hide(); $(".show-overview").html("more..."); $(".show-overview").click(function() { $(".overview-continued").slideToggle("1000"); $(".show-overview").html("less..."); return false; }); });

    Read the article

  • How to get text value in a div vs. an alert modal - jquery

    - by smudge
    Does anyone have an easy way to have text in a div show what's changed in the following statement vs. an alert modal? I can't seem to get my head around it. Thanks... $(function(){ var abc = $('select#percent').selectToUISlider(); labels: 0 $('select#valueA, select#valueB').selectToUISlider({ labels: 0, sliderOptions: { change:function(e, ui) { alert('changed'+$('select#valueA option').eq(ui.values[0]).text()); alert('changed'+$('select#valueB option').eq(ui.values[1]).text()); } } });

    Read the article

  • jquery(selector) how to select the last element from two different classes

    - by Yasir Laghari
    for the following html <div> <div class="col1" > I dont want to select this </div> <div class="col2"> I dont want to select this </div> <div class="col1"> I dont want to select this </div> <div class="col1"> I dont want to select this </div> <div class="col2"> I WANT to select this </div> </div> How do I select the last element with two different class names? Tried using $("col1:last,col2:last) but it gives back 2 elements tried $("col1,col2:last") and this gives all col1 and last of col2

    Read the article

< Previous Page | 65 66 67 68 69 70 71 72 73 74 75 76  | Next Page >