Search Results

Search found 23820 results on 953 pages for 'jquery ui autocomplete'.

Page 77/953 | < Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >

  • 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

  • SlideUp Function on Jquery

    - by Silent
    i have a slide up function and a slide down on my script, everything works. The problem is that the DIVs are collapse and not hidden how would i be able to hide the divs on page start up. i tried to set the DIV to hidden but no luck with that.

    Read the article

  • jQuery mobile swipe spamming and animation

    - by halliewuud
    I have say 5 list items with images inside placed 200px from eachother. I am trying to animate these list items to slide horizontally left if one presses a link with the id = #next or if one swipes left. And vice versa for sliding the list items right. Every click or swipe results in a slide animation of 200px on every list item. I ran into a problem where spamming the #next or #prev button would cancel the current animation and start a new one. This results in list items not sliding 200px+200px+200... but something like this 200px+140px+120... This because like I said the animation is cut and therefore the sliding distance will be shorter. Now I solved this for the clicking event by disabling the button before the animation starts and then re'enabling it on the end callbak function. But this problem is remaining for the swipe event. How can I solve this problem for the swipe event?

    Read the article

  • jQuery click event behaves differently with live function in Firefox

    - by fjsj
    Using the event click with live function leads to strange behavior when using Firefox*. With live in Firefox, click is triggered when right-clicking also! The same does not happen in Internet Explorer 7 neither in Google Chrome. Example: Without live, go to demo and try right clicking the paragraphs. A dialog menu should appear. With live, go to demo and try right clicking "Click me!". Now both dialog menu and "Another paragraph" appear. *tested with firefox 3.5.3

    Read the article

  • jQuery - Animate function

    - by Arun Kumar
    I have a piece of code shown below: $(".tagArea li").mouseover(function(){ $(this).animate({ borderWidth: "2px" }, 1000 ); }); $(".tagArea li").mouseout(function () { $(this).animate({ borderWidth: "1px" }, 1000 ); }); When I try to hover it on a particular list item, it properly animates but doesn't stop doing just once. It keeps doing 2 or 3 times. How to avoid this, I 've tried many a times but no positive result occurs to me. Kindly help.

    Read the article

< Previous Page | 73 74 75 76 77 78 79 80 81 82 83 84  | Next Page >