Search Results

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

Page 113/953 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • Jquery drag /drop and clone

    - by Sajeev
    Hi I need to achive this .. I have a set of droppable items ( basically I am droping designs on a apparel ) and I am dropping a clone.. If I don't like the dropped object (designs) - I want to delete that by doing something like hidden . But I am unable to do that. Please help me.. here is the code var clone; $(document).ready(function(){ $(".items").draggable({helper: 'clone',cursor: 'hand'}); $(".droparea").droppable({ accept: ".items", hoverClass: 'dropareahover', tolerance: 'pointer', drop: function(ev, ui) { var dropElemId = ui.draggable.attr("id"); var dropElem = ui.draggable.html(); clone = $(dropElem).clone(); // clone it and hold onto the jquery object clone.id="newId"; clone.css("position", "absolute"); clone.css("top", ui.absolutePosition.top); clone.css("left", ui.absolutePosition.left); clone.draggable({ containment: 'parent' ,cursor: 'crosshair'}); $(this).append(clone); alert("done dragging "); /lets assume I have a delete button when I click that clone should dissapear so that I can drop another design - but the following code has no effect //and the item is still visible , how to make it dissapear ? $('#newId').css("visibility","hidden"); } }); });

    Read the article

  • jQuery('body').text() gives different answers in different browsers

    - by Charles Anderson
    My HTML looks like this: <html> <head> <title>Test</title> <script type="text/javascript" src="jQuery.js"></script> <script type="text/javascript"> function init() { var text = jQuery('body').text(); alert('length = ' + text.length); } </script> </head> <body onload="init()">0123456789</body> </html> When I load this in Firefox, the length is reported as 10. However, in Chrome it's 11 because it thinks there's a linefeed after the '9'. In IE it's also 11, but the last character is an escape. Meanwhile, Opera thinks there are 12 characters, with the last two being CR LF. If I change the body element to include a span: <body onload="init()"><span>0123456789</span></body> and the jQuery call to: var text = jQuery('body span').text(); then all the browsers agree that the length is 10. Clearly it's the body element that's causing the issue, but can anyone explain exactly why this is happening? I'm particularly surprised because the excellent jQuery is normally browser-independent.

    Read the article

  • jQuery validate : multiple form, single validation

    - by I-M-JM
    Hi all I have 2 forms, namely (ids mentioned) 'add_product' and 'edit_product' Now I am using jQuery validation plug-in, both the forms have same validation (similar to mentioned in following example) jQuery("#add_product").validate({ rules: { name:"required", price:"number" }, messages: { name:"Please enter Plan Name", price:"Enter a valid number" } }); and jQuery("#edit_product").validate({ rules: { name:"required", price:"number" }, messages: { name:"Please enter Plan Name", price:"Enter a valid number" } }); I want to combine them into 1 rule/function, how can I achieve this? Thanks

    Read the article

  • question about jQuery droppable/draggable.

    - by FALCONSEYE
    I modified a sample photo manager application. photo manager application Instead of photos, I have employee records coming from a query. My version will let managers mark employees as on vacation, or at work. One of the things I did is to include employee ids like <a href="123">. I get the ids from event.target. This works for the click function but not for the "droppable" function. This is what I have for the click function: $('ul.gallery > li').click(function(ev) { var $item = $(this); var $unid = ev.target; var $target = $(ev.target); if ($target.is('a.ui-icon-suitcase')) { deleteImage($item,$unid); } else if ($target.is('a.ui-icon-arrowreturnthick-1-w')) { recycleImage($item,$unid); } return false; }); ev.target correctly gives the employee id. when i try the same in one of the droppable functions: $gallery.droppable({ accept: '#suitcase li', activeClass: 'custom-state-active', drop: function(ev, ui) { var $unid = ev.target; alert($unid); recycleImage(ui.draggable,$unid); } }); the alert(ui) gives me [object]. What's in this object? How do i get the href out of this? thanks

    Read the article

  • Content pulled in via jQuery AJAX is not associating with previous functions

    - by Jarsen
    I'm using the jquery .load() function to pull in data to populate a div with. The content I'm pulling in has CSS selectors that should match up with jQuery click functions I've written. However, when I load in the data, although the correct CSS selectors are there, when I click on areas that should invoke a response from jQuery, nothing happens. Do I need to do some sort of reload? Here's the code I've got for the jQuery AJAX: $(document).ready(function() { // AJAX functionality for drupal nodes $(".ajax_node").click(function() { var ajax_src = $(this).attr("href"); // we're gonna load the href // empty target div and load in content // the space in the string before the #id is necessary $("#ajax_area").empty().load(ajax_src + " #ajax_wrapper"); return false; // stops the link from following through }); // General AJAX fucntionality $(".ajax").click(function() { var ajax_src = $(this).attr("href"); $("#ajax_area").empty().load(ajax_src); return false; }); });

    Read the article

  • Can't get jQuery to wokr with Prototype - tried everything....

    - by thinkfuture
    Ok so here is the situation. Been pulling my hair out on this one. I'm a noob at this. Only been using rails for about 6 weeks. I'm using the standard setup package, and my code leverages prototype helpers heavily. Like I said, noob ;) So I'm trying to put in some jQuery effects, like PrettyPhoto. But what happens is that when the page is first loaded, PrettyPhoto works great. However, once someone uses a Prototype helper, like a link created with link_to_remote, Prettyphoto stops working. I've tried jRails, all of the fixes proposed on the JQuery site to stop conflicts... http://docs.jquery.com/Using_jQuery_with_Other_Libraries ...even done some crazy things likes renaming all of the $ in prototype.js to $$$ to no avail. Either the prototype helpers break, or jQuery breaks. Seems nothing I do can get these to work together. Any ideas? Here is part of my application.html.erb <%= javascript_include_tag 'application' %> <%= javascript_include_tag 'tooltip' %> <%= javascript_include_tag 'jquery' %> <%= javascript_include_tag 'jquery-ui' %> <%= javascript_include_tag "jquery.prettyPhoto" %> <%= javascript_include_tag 'prototype' %> <%= javascript_include_tag 'scriptalicious' %> </head> <body> <script type="text/javascript" charset="utf-8"> jQuery(document).ready( function() { jQuery("a[rel^='prettyPhoto']").prettyPhoto(); }); </script> If I put prototype before jquery, the prototype helpers don't work If I put the noconflict clause in, neither works. Thanks in advance! Chris

    Read the article

  • Jasmine DOM test using jasmine jquery with require module

    - by Purushoth
    I am using custom variant of jasmine 2.0 from here https://github.com/erikringsmuth/jasmine2-amd-specrunner. So that testing my require.js based application made possible. Here i have facing problem with using jasmine-jquery. The jasmine object is undefined. $ and window is fine. function (window, jasmine, $) I have reference added jasmine and jquery lib too <script type="text/javascript" src="lib/jasmine.js"></script> <script type="text/javascript" src="lib/jquery-2.1.1.min.js"></script> <script type="text/javascript" src="lib/helpers/jasmine-jquery.js"></script>

    Read the article

  • ASP.NET MVC jQuery: Shoud we be concerned about a lot of jQuery/javascript on a View?

    - by Mark Redman
    We are moving from WebForms to MVC and and using a lot of jQuery. I appears we have a lot of jQuery/JavaScript in our Views, is this common and are there any concerns about security. The obvious step is to refactor into plugins and more generic UserControls etc, but this jQuery would still be "visible" by looking at js files etc. We are validating everything on the server-side anyway but should we be concerned?

    Read the article

  • Add an easing to jQuery animate() function.

    - by user348250
    Hello! I'm triying to add an easing function to this code. So I replaced "swing" with "easeInOutQuint" (for example) but it's not working. I'm using jquery 1.4.2 and jquery easing 1.3 downloaded from here (http://gsgd.co.uk/sandbox/jquery/easing/) Any help will be greatly appreciated! Thank you! $(window).load(function() { $('.trigger').click(function() { $('.panel').animate({ width: ['toggle', 'swing'], height: ['toggle', 'swing'], opacity: 'toggle' }, 190, 'linear', function() { }); });

    Read the article

  • jquery show hidden div

    - by Fahad
    Firstly, I'm sort of embarrassed asking about this, so many people have already asked this question but even after having gone through so many posts, I'm unable to achieve what I want. Basically, a div, initially hidden, has to be displayed on a button click. I tried hiding the div using display:none and hide() and then displaying it using show(), toggle(), and css("display","block"). Using all sorts of combinations of the above, I was still unable to get the result. Code: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <link href="css/smoothness/jquery-ui-1.9.2.custom.min.css" rel="stylesheet" type="text/css" /> <script src="jQuery/jquery-1.8.3.min.js" type="text/javascript"></script> <script src="jQuery/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#one').hide(); $('#Button1').click(function () { $('#one').toggle(500); }); }); </script> </head> <body> <form id="form1" runat="server"> <div id="one" style="height: 20px;width:200px; background-color: Red; "> </div> <asp:Button ID="Button1" runat="server" Text="Show" /> </form> </body> </html> On button click, the div is shown for a brief second before it disappears again. The same thing happens if I use show() instead of toggle() in the above code. Again the same thing if I set style="display:none" to the div instead of using hide() and then use show() or toggle(). I also tried using $('#one').css("display","block"); but again, the same result. Can anyone please tell me where I'm going wrong. Just started learning jQuery and it is really frustrating when something apparently so simple will not work. Thanks in advance. :)

    Read the article

  • jquery append 'x' number images elements applying 'x' to src and class

    - by Yusaf
    I have a directory with 590 pictures and my issue is being able to pull images using jquery alone from that directory and appending them which i have found out can not be done alone using jquery/javascript. alternatively i have renamed the pictures 1.jpg,2.jpg ... 590.jpg . how using jquery can i append 590 images to a div leaving me with the number of the appended element applied to the src being 'lq'+numberofappended+'.jpg' and class being 'image-'+numberofappended as a result leaving me with the below <div class="imagecontainer"> <img src="lq/1.jpg" class="image-1"/> <img src="lq/2.jpg" class="image-2"/> <img src="lq/3.jpg" class="image-3"/> ... <img src="lq/590.jpg" class="image-590"/> </div> if what I have will be too extensive can i append 50 images at a time and apply a jquery pagination loading another 50 each time i reach the end of the page. I personally know how to use append in jquery but I don't know how to individually append an image and depending on which append number it is applying it to the src and class.

    Read the article

  • jQuery not taking effect immediately.

    - by iMaster
    Is there any reason for my jQuery effects not to be taking effect immediately? I have jQuery hover fade effects, but then I also have CSS rollovers as backups for anyone who has javascript disabled. What happens is when you load a page and roll over a link, you get the CSS effect, but any time after that, you get the nice, smooth jQuery effect. Is there a fix for this?

    Read the article

  • Retrieving information from DOM elements returned using ajax

    - by niczoom
    I am new(ish) to jQuery and am testing out the extraction of DOM element data using jQuery. Below, detailed on the firebug console I tried to extract data 10 different ways (from 1- to 10-) using data returned directly from the ajax request (rtnData). And then to compare, I wrapped (rtnData) in a div to make it a jQuery object, and stored it in $test, (var $test= $('<div/>').html(rtnData);) Displayed below in Firebug Console Output, I cant figure out is why 5- return's nothing and e- returns the center tag contents. Same with 8- and e-, they both look for #ticker div id but 8- returns nothing and e- returns the correct html?? Also when searching for h1 tag .text(), why does 10- return blank and j- return the correct data? Thanks, Nic. Use the following page to run the ajax request below in Firebug Console: http://www.liamharding.com/pgi/pgi.php jQuery code ran using Firebug Console: $.ajax({ url: 'pgiproxy.php', type: 'POST', dataType: 'html', data: ({ data : $("#formdata").serialize(), mode : "graph"}), success: function(rtnData){ console.log("0- ", rtnData); console.log("1- ", $('img', rtnData)); console.log("2- ", $('a', rtnData)); console.log("3- ", $('span.cr', rtnData)); console.log("4- ", $('span.cr', rtnData).html()); console.log("5- ", $('center', rtnData)); console.log("6- ", $('table', rtnData)); console.log("7- ", $('#ticker_data', rtnData)); console.log("8- ", $('#ticker', rtnData)); console.log("9- ", $('#last', rtnData)); console.log("10- ", $('h1', rtnData).text()); var $test= $('<div/>').html(rtnData); console.log("z- ", $test); console.log("a- ", $('img', $test)); console.log("b- ", $('a', $test)); console.log("c- ", $('span.cr', $test)); console.log("d- ", $('span.cr', $test).html()); console.log("e- ", $('center', $test)); console.log("f- ", $('table', $test)); console.log("g- ", $('#ticker_data', $test)); console.log("h- ", $('#ticker', $test)); console.log("i- ", $('#last', $test)); console.log("j- ", $('h1', $test).text()); }, error: function(){ alert('ERROR'); } }); Firebug Console Output: 1- jQuery(img#GnuPlotChart 624e4629...8946.gif) 2- jQuery(a.button javascri...eload();, a.button javascri...close();) 3- jQuery(span.cr) 4- <span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span> 5- jQuery() 6- jQuery(table.rbox-table) 7- jQuery(div#ticker_data.rbox) 8- jQuery() 9- jQuery(th#last, td#last.num) 10- z- jQuery(div) a- jQuery(img#GnuPlotChart 624e4629...8946.gif) b- jQuery(a.button javascri...eload();, a.button javascri...close();) c- jQuery(span.cr) d- <span class="tl"></span><span class="tr"></span><span class="bl"></span><span class="br"></span> e- jQuery(center) f- jQuery(table.rbox-table, table) g- jQuery(div#ticker_data.rbox) h- jQuery(div#ticker) i- jQuery(th#last, td#last.num) j- Legacy Charts

    Read the article

  • Display the text label for selected radio button in Jquery

    - by Thinker
    Hai, I have a group of radio buttons, i could able to pick the selected value using jQuery but not the text label for selected values. for ex: <input type="radio" value="1" name="priority">High</input> <input type="radio" value="2" name="priority">Medium</input> <input type="radio" value="3" name="priority">Low</input> JQUERY CODE TO PICK THE SELECTED VALUE jQuery('input:radio[name=priority]').change(function() { var priority_type=jQuery(this).attr("value"); alert(priority_type); } OUTPUT would be any one of the following (1,2,3) Now my requirement is, i would like to display the label of the selected values for eg (high or low or medium) depends on the selection of the radio button. Hope this helps. let me know if you have any question. Kindly help me in this task

    Read the article

  • jQuery .getJSON() Not Parsing All Objects

    - by Brad
    I'm using jQuery's .getJSON function to parse a set of search results from a Google Search Appliance. The search appliance has an xslt stylesheet that returns the results as JSON data, which I validated with both JSONLint and Curious Concept's JSON Formatter. According to FireBug, the full result set is returned from the XMLHTTPRequest, but I tried dumping the data (with jquery.dump.js) and it only ever parses back the first result. It does successfully get all the Google Search Protocol stuff, but it only ever sees one "R" object (or individual result). Has anybody had a similar problem with jQuery's .getJSON? I know it likes to fail silently if the JSON is not valid, but like I said, I validated the results with several validators and it should be good to go. Edit: Clicking this link will show you the JSON results returned for a search for the word "google": http://bigbird.uww.edu/search?client=json_frontend&proxystylesheet=json_frontend&proxyrefresh=1&output=xml_no_dtd&q=google jQuery only retrieves the first "R" object, even though all "R" objects are siblings.

    Read the article

  • Use JS to add characters into textfield

    - by Thomas
    I want to add a $ symbol before a users entry into a text field without actually submitting the $ when the user clicks submit. Additionally, I need to prohibit the user from entering anything but numerical values in to the text input. I know about the JQuery input mask (http://www.conetrees.com/2009/03/blog/jquery-masked-input-plugin-increase-usability-for-masked-format-input-fields) but this plugin requires you to set the exact number of digits/letters that the user is supposed to enter, which is no good for my current project. Can anyone think of a way to accomplish what I have described above?

    Read the article

  • Use jQuery to open PDF links with Google Docs

    - by Scott
    I already have pdf links set up. I am just looking to prepend Google's syntax in front of my current href using jQuery. i know the following doesn't work, but I feel I am close…? jQuery(document).ready(function() { jQuery("a[href$=.pdf]").attr("href", "http://docs.google.com/viewer?url=" + current.href); }); Can anyway help, please?

    Read the article

  • Error occure while validating form input using JQUERY in Firebug

    - by Param-Ganak
    Hello Friends, I have written a custom validation code in JQUERY. which is working fine. I have a login form which have two fields i.e. userid and password. I have written a custom JQUERY code for client side validation for these fields. This custom JQUERY code is working fine and gives me proper error messages as per the situation. But the problem with this code is that when I enter the invalid data in any or both field and press submit button of form then it displays the proper error message but at the same time when I checked it in Firebug it displays following error message when submit button of the form is clicked validate is not defined function onclick(event) { javascript: return validate(); }(click clientX=473, clientY=273) So please tell me where is I am wrong in my Jquery code. Thank You!

    Read the article

  • can't implement jquery jScrollPane to replace browser's scrollbars

    - by Zack
    I am trying to replace browser's scrollbars with jScrollPane (jQuery), it won't work. Here are two attempts to implement it: a basic attempt, and an attempt to imitate the full page demo for jScrollPane. I've been trying everything I could think of to figure out what didn't work, but couldn't. here is my code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <!-- styles needed by jScrollPane --> <link type="text/css" href="style/jquery.jscrollpane.css" rel="stylesheet" media="all" /> <style type="text/css" id="page-css"> /* Styles specific to this particular page */ html { overflow: auto; } #full-page-container { overflow: auto; } .scroll-pane { width: 100%; height: 200px; overflow: auto; } .horizontal-only { height: auto; max-height: 200px; } </style> <!-- latest jQuery direct from google's CDN --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <!-- the mousewheel plugin --> <script type="text/javascript" src="script/jquery.mousewheel.js"></script> <!-- the jScrollPane script --> <script type="text/javascript" src="script/jquery.jscrollpane.min.js"></script> <script type="text/javascript" id="sourcecode"> $(function () { var win = $(window); // Full body scroll var isResizing = false; win.bind( 'resize', function () { if (!isResizing) { isResizing = true; var container = $('#full-page-container'); // Temporarily make the container tiny so it doesn't influence the // calculation of the size of the document container.css( { 'width': 1, 'height': 1 } ); // Now make it the size of the window... container.css( { 'width': win.width(), 'height': win.height() } ); isResizing = false; container.jScrollPane( { 'showArrows': true } ); } } ).trigger('resize'); // Workaround for known Opera issue which breaks demo (see // http://jscrollpane.kelvinluck.com/known_issues.html#opera-scrollbar ) $('body').css('overflow', 'hidden'); // IE calculates the width incorrectly first time round (it // doesn't count the space used by the native scrollbar) so // we re-trigger if necessary. if ($('#full-page-container').width() != win.width()) { win.trigger('resize'); } }); </script> </head> <body> <div id="full-page-container"> This is the most basic implementation of jScrollPane I could create, if I am not wrong this has all it should take, yet it doesn't work. a little lorem ipsum to make the scrollbars show up: [here come's lot's of lorem ipsum text in the actual page...] </div> </body> </html> The other option is the same, with a link to demo.css and demo.js.

    Read the article

  • FBML + jquery Validation + Rails

    - by user359467
    Hi all, In my local machine i have a scaffold that uses Jquery Validation plugin for the field's validation. Now i want to add that to a fbml facebook application, but i'm haven't been able to load the jquery javascript and the jquery Validation plugin into the app, does anybody now how to do that? or maybe someone could suggest me a better way of doing validation inside a facebook application. Thanks in Advance Ernesto Carrión

    Read the article

  • jQuery slider not working in Wordpress plugin

    - by Matt Facer
    I've written a plugin for wordpress and I want to use a slider on my page. In it's most basic form (now) to test, I have the for the slider on my page <div id="wpge-slider"></div> then in the plugin, I have my init action add_action('init', 'wpge_init' ); function wpge_init() { wp_enqueue_script('jquery'); wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('wpge_search_results', get_bloginfo('wpurl') . '/wp-content/plugins/myplugintest/js/wpge_search_results.js', array('jquery'), '1.0'); } then in my own javascript page, I have jQuery(document).ready(function($) { $("#wpge-slider").slider(); }); Everything (to me) looks ok, and the scripts ARE being called in the header. I can see them on the page... yet the slider is not showing. Can anyone see where I'm going wrong?!

    Read the article

  • jquery files conflicts how to detect?

    - by user418343
    Q:i have a general problem ,,when i wanna to do some thing and i find the jquery file which can do exactly what i wanna to do .. after a while i need another case and i find that another jquery file serve me and fix my problem .. after i add set of jquery files i find conflicts among those files and some features does not work or work in awkward manner ..and when i try to find which file exactly the source for those problems i find myself in closed circle cannot modify this file or cannot delete this file or cannot find that file itself at all ..sometimes the file like this:: <script src="http://jqueryjs.googlecode.com/files/jquery-1.3.js" type="text/javascript"></script> cannot modify it.. the problem has many faces ,, and i cannot really know how to handle the whole matter from the beginning... can any one give me instructions ,, advices,, notes, or explanation to prevent the problem from the beginning and how to fix it if it was happened..

    Read the article

  • jQuery: Sorting hierarchical data?

    - by Industrial
    Hi everybody, I have tried for some time to work out a way of sorting nested categories with jQuery. I failed to build my own plugin to do this, so I tried to find something that were available already. Tried a few hours now with this one, http://www.jordivila.net/code/js/jquery/ui-widgetTreeList_inheritance/widgetTreeListSample.aspx and cant get it to work. What are the alternatives of creating a jQuery / jQuery UI script that handles sorting children and parent categories in a way that can be combined with a AJAX PHP backend to handle the actual sorting in the database? Thanks!

    Read the article

  • How can I revert a 'draggable' upon failed AJAX request?

    - by Frank
    I have a draggable div, that needs to be dropped on a droppable. If it is dropped correctly, the droppable calls an AJAX request. If the draggable does not have a valid id or the AJAX request fails, the draggable should be reverted to it's original position. Is that something that can be done with jQuery?! Any help is greatly appreciated!! $("div.draggable").livequery(function(){ $(this).draggable({ revert: 'invalid', distance: 20 }) }); $("#trash").droppable({ tolerance: 'touch', drop: function(event, ui) { var item = ui.draggable; var id = item.attr('id'); if (id) { $.ajax( { type: "POST", url: "delete.php", data: "id=" + id, success: function(html) { if (html) { item.remove(); } else { // FAILED AFTER AJAX // is it possible to revert the draggable from here?? } } }); } else { // FAILED BEFORE AJAX // is it possible to revert the draggable from here?? } } });

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >