Search Results

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

Page 50/935 | < Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >

  • Help with manipulating child/parent elements with jQuery

    - by Mohammad
    Currently I have this JQuery script var img = $(this); img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); which successfully turns the following: <img src="photo.jpg" alt="caption"> into this <div class="photo"> <img src="photos.jpg" alt="caption"/> <p>caption</p> </div> All is well unless the image has a link as a parent; <a href="#"><img since I want it to be correct html (I'm fussy) improving the resulting outcome bellow would be satisfactory <a href="#"> <div class="photo"> <img src="photos.jpg" alt="caption"/> <p>caption</p> </div> </a> to this: <div class="photo"> <a href="#"> <img src="photos.jpg" alt="caption"/> </a> <p><a href="#">caption</a></p> </div> </a> This is my jQuery script so far (which doesn't work bc I'm a noob) aha if(img.parent('a')){ var targetLink = img.parent('a').attr('href').val(); img.parent('a').wrap('<div class="photo"></div>'); img.parent('div').append('<p><a href="'+targetLink+'">' + img.attr("alt") + '</p></a>'); }else{ img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); }; Any advice, or help will be greatly appreciated : ) Thank You! Update *Answer* (works but looks sloppy) I'm editing it atm; if(img.parent('a').length){ var targetLink = img.parent().attr('href'); img.parent().wrap('<div class="photo"></div>'); var divTarget = img.parent('a').parent('div'); divTarget.append('<p><a href="'+targetLink+'">' + img.attr("alt") + '</p></a>'); }else{ img.wrap('<div class="photo"></div>'); img.parent().append("<p>" + img.attr("alt") + "</p>"); };

    Read the article

  • How to implement a tagging plugin for jQuery

    - by anxiety
    Goal: To implement a jQuery plugin for my rails app (or write one myself, if necessary) that creates a "box" around text after a delimiter is typed. Example: With tagging on SO, the user begins typing a tag, then selects one from the drop-down list provided. The input field recognizes that a tag has been selected, puts a space and then is ready for the next tag. Similarly, I am attempting to use this plugin to put a box around the previously entered tag before moving to to accept the next tag/input. The instructions in the README.txt seem simple enough, however I have been receiving a $(".tagbox").tagbox is not a function error when debugging my app with firebug. Here is what I have in my application.js: $(document).ready( function(){ $('.tagbox').tagbox({ separator: /\[,]/, // specifying comma separation for <code>tags</code> }); }); And here is my _form.html.erb: <% form_for @tag do |f| %> <%= f.error_messages %> <p> <%= f.label :name %><br /> <%= text_field :tag, :name, { :method => :get, :class => "tagbox" } %> </p> <p><%= f.submit "Submit" %></p> <% end %> I have omitted some other code (namely the implementation of an autocomplete plugin) existing within my _form.html.erb and application.js for sake of readability. The inclusion or exclusion of this omitted code does not affect the performance of this plugin. I have included all of the necessary files for the tagbox plugin (as well as application.js after all other included JS files) within the javascript_include_tag in my application.html.erb file. I'm pretty much confused as to why I'd be getting this "not a function" error when jquery.tagbox.js clearly defines the function and is included in the head of my html page in question. I've been struggling with this plugin for longer than I'd like to admit, so any help would really be appreciated. And, of course, I'm open to any other plugins or from-scratch suggestions you may have in mind.. This tagbox plugin does not seem to have a wealth of documentation or any currently working examples. Also to note, I'm trying to avoid using jrails. Thanks for your time

    Read the article

  • Jquery: Filter dropdown list as you type

    - by rmbarnes
    I have used a prototype plugin which filters the contents of a dropdown as you type. So for example if you typed 'cat' into the text box, only items containing the substring 'cat' would be left as options in the drop down. Does anyone know of a jquery plugin which can do this?

    Read the article

  • jQuery AJAX POST gives undefined index

    - by Sebastian
    My eventinfo.php is giving the following output: <br /> <b>Notice</b>: Undefined index: club in <b>/homepages/19/d361310357/htdocs/guestvibe/wp-content/themes/yasmin/guestvibe/eventinfo.php</b> on line <b>11</b><br /> [] HTML (index.php): <select name="club" class="dropdown" id="club"> <?php getClubs(); ?> </select> jQuery (index.php): <script type="text/javascript"> $(document).ready(function() { $.ajax({ type: "POST", url: "http://www.guestvibe.com/wp-content/themes/yasmin/guestvibe/eventinfo.php", data: $('#club').serialize(), success: function(data) { $('#rightbox_inside').html('<h2>' + $('#club').val() + '<span style="font-size: 14px"> (' + data[0].day + ')</h2><hr><p><b>Entry:</b> ' + data[0].entry + '</p><p><b>Queue jump:</b> ' + data[0].queuejump + '</p><br><p><i>Guestlist closes at ' + data[0].closing + '</i></p>'); }, dataType: "json" }); }); $('#club').change(function(event) { $.ajax({ type: "POST", url: "http://www.guestvibe.com/wp-content/themes/yasmin/guestvibe/eventinfo.php", data: $(this).serialize(), success: function(data) { $('#rightbox_inside').hide().html('<h2>' + $('#club').val() + '<span style="font-size: 14px"> (' + data[0].day + ')</h2><hr><p><b>Entry:</b> ' + data[0].entry + '</p><p><b>Queue jump:</b> ' + data[0].queuejump + '</p><br><p><i>Guestlist closes at ' + data[0].closing + '</i></p>').fadeIn('500'); }, dataType: "json" }); }); </script> I can run alerts from the jQuery, so it is active. I've copied this as is from an old version of the website, but I've changed the file structure (through to move to WordPress) so I suspect the variables might not even be reaching eventinfo.php in the first place... index.php is in wp-content/themes/cambridge and eventinfo.php is in wp-content/themes/yasmin/guestvibe but I've tried to avoid structuring issues by referencing the URL in full. Any ideas?

    Read the article

  • formatting sourcecode using jQuery

    - by Sorskoot
    Does anyone know if there's a jQuery plugin to format code, XML or HTML? I'm showing the user some code on an html page. I used google prettify to make the code look pretty, but would like some indentation and linebreaks too. any suggestions?

    Read the article

  • Expanding / grow a JQuery element selection?

    - by HipHop-opatamus
    In the Jquery example below, I would like to expand $(this) before it is cloned, so it includes everything contained in the parent class "comment". How do I do this? I've tried using ReplaceWith($(this).parent('.comment').clone()... and it does not work! $(document).ready( function(){ $('.forumthreadtitle').siblings().hide(); $('.forumthreadtitle').click( function() { $('#first-post').replaceWith($(this).clone().attr('id','first-post')); });

    Read the article

  • Zazzle.com Image Zoom effect using jQuery

    - by mikemick
    Is there a jQuery plugin that mimics the Zazzle.com photo zoom effect (you can view the effect here: http://www.zazzle.com/awards+tshirts). The closest I've found is the jQZoom plugin which opens the larger image in a separate container, instead of overlaying within the same container. I figured I'd ask, before I started building away on this...

    Read the article

  • Memory Leak with jQuery UI inside UpdatePanel in ie7

    - by Ryan
    I have a fairly complex asp.net page based on UpdatePanels and jQuery UI. Unfortunately, when the panels update, the jQuery UI widgets leak memory like crazy in ie7, even if I manually 'destroy' them. Does anyone know a technique/patch to prevent these leaks? I've created a simple example page with a slider inside an UpdatePanel. Just click the 'Leak' button and refresh the page to see the leak in sieve. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Leak2.aspx.cs" Inherits="Leak2" %> <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Leak</title> <link type="text/css" href="/jquery/css/custom-theme/jquery-ui-1.7.2.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="/jquery/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/jquery/js/jquery-ui-1.7.2.custom.min.js"></script> </head> <body> <form id="form1" runat="server"> <div> <script type="text/javascript"> function initializeSlider() { $(".slider").slider({ min: 0, max: 100, value: 100, step: 5 }); } $(document).ready(function() { initializeSlider(); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { initializeSlider(); }); }); </script> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div style="width: 300px;"> <div class="slider"></div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Leak" /> </div> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>

    Read the article

  • Using Jquery to pull Wordpress post feed into static page

    - by JCHASE11
    Just like using the many twitter or facebook widgets out there that pull the feed and display it in a nice widget, I want to create a "widget" that pulls a feed from a wordpress blog that I have, and displays it on a static, non-wordpress page. Before I try getting my hands dirty with jquery, do you know if there is any pre-existing code or plugins out there that I can use?

    Read the article

  • Expression builder in Javascript or jQuery?

    - by morpheous
    I am searching for an expression builder GUI (like the one used in Microsoft Access). It can be plain Javascript or JQuery plugin. I am loathe to build my own and reinvent the wheel if one already exists - and yet, a search on Google does not find anything remotely useful. Is anyone aware of any such library/plugin or article that covers this?

    Read the article

  • jquery contains with class

    - by proee
    I'm using jQuery :contains selector to filter through some link tags. The following code works great. $('a:contains('string').each(function(i){ //do some stuff }); I'd like only run this function if the anchor tags are inside a specific class, I've tried the following but it does not appear to work: $('my_class a:contains('string').each(function(i){ //do some stuff });

    Read the article

  • How do I remove elements from a jQuery wrapped set

    - by Bungle
    I'm a little confused about which jQuery method and/or selectors to use when trying to select an element, and then remove certain descendant elements from the wrapped set. For example, given the following HTML: <div id="article"> <div id="inset"> <ul> <li>This is bullet point #1.</li> <li>This is bullet point #2.</li> <li>This is bullet point #3.</li> </ul> </div> <p>This is the first paragraph of the article</p> <p>This is the second paragraph of the article</p> <p>This is the third paragraph of the article</p> </div> I want to select the article: var $article = $('#article'); but then remove <div id="inset"></div> and its descendants from the wrapped set. I tried the following: var $article = $('#article').not('#inset'); but that didn't work, and in retrospect, I think I can see why. I also tried using remove() unsuccessfully. What would be the correct way to do this? Ultimately, I need to set this up in such a way that I can define a configuration array, such as: var selectors = [ { select: '#article', exclude: ['#inset'] } ]; where select defines a single element that contains text content, and exclude is an optional array that defines one or more selectors to disregard text content from. Given the final wrapped set with the excluded elements removed, I would like to be able to call jQuery's text() method to end up with the following text: This is the first paragraph of the article.This is the second paragraph of the article.This is the third paragraph of the article. The configuration array doesn't need to work exactly like that, but it should provide roughly equivalent configuration potential. Thanks for any help you can provide!

    Read the article

  • use JQuery to get a list of classes

    - by John
    Hi I have a un-ordered (ul) html list. Each li item has 1 or more classes attached to it. I want to go through this ul list and get all the (distinct) classes. Then from this list create a list of checkboxes who's value matches that of the class and also who's label matches that of the class. One checkbox for each class. What is the best way to do this using JQuery? Thanks

    Read the article

  • jQuery validation plugin for two fields

    - by jonathan p
    I am using the Jquery Validation plug-in, however i need to add a "custom rule", i have 2 date fields and i need to ensure that the end date is not less than the start date. My problem is how to pass the two fields in as elements. As i understand u set up a custom function something like this : function customValidationMethod(value, element, params){ } But can't see how i could use it with two fields, if anyone has any ideas it would be greatly appreciated.

    Read the article

  • Internet Explorer 8 and jQuery Cycle Plugin, Fading artifacts

    - by ion
    Hi, I am using the jQuery cycle plugin to fade in and out png images on top of a transparent background. Just from the description you can understand that I'm running into graphic artifacts on explorers. The link to the page is: http://www.ionline.gr/keavillage Could you propose an alternative [except flash] or any way I could edit the existing set-up and have a perfect fade-in fade-out of the text? Thanks

    Read the article

  • JQuery AJAX responseText to JSON

    - by BoredOfBinary
    I have this script that calls a .net WebService msg = $.toJSON( $.ajax({ type: "POST", url: "http://[url]/ETS.UI/WebServices/LocationService.asmx/GetMappingLocationDetails", contentType: "application/json; charset=utf-8", data: $.toJSON({'componentId':994}), dataType: "json", async: false }).responseText ); And I recieve the following value in the msg variable: ""{\"d\":\"{\\"ComponentId\\":994,\\"Latitude\\":32.219627009236405,\\"Longitude\\":-110.96843719482422,\\"LocationName\\":\\"Tucson\\",\\"StreetAddress\\":\\"7201 E 22nd Street \\",\\"City\\":\\"Tucson\\",\\"State\\":\\"AZ\\",\\"PostalCode\\":null}\"}"" I have no idea why this would format this way, seems to only do this in responseText. Does anyone have any ideas?

    Read the article

  • Track Users of Website With JQuery Plugin

    - by grungefreak1
    Hi, Is there a way to track users of my site (based on Session ID's) using JQuery? I would like to know what pages and how long they spent on each page for example. Or any other suggestions are welcome. I had tried this with Google Analytics but I cannot seem to track individual users based on an ID. GF

    Read the article

  • Generating thumbnails using jquery or javascript

    - by Hulk
    All, Can any 1 of you show a small piece of code for generating a thumbnail of any website using javascript or jquery, I had posted earlier but couldnt find any right match for my requirements. <div id="generate_thumbnail" onclick ="generate();"> //Show thumbnail within this div </div> <Script> function generate() { // generate small thumbnail }

    Read the article

  • JQuery Cascade dropdown problem?

    - by omoto
    Hi All! I'm using JQuery based Cascade plugin probably it's working, but I found a lot of problems with it Maybe somebody already faced with this plugin and maybe could help. So, I using this plugin for location filtration Here comes my CS code: public JsonResult getChildren(string val) { if (val.IsNotNull()) { int lId = val.ToInt(); Cookie.Location = val.ToInt(); var forJSON = from h in Location.SubLocationsLoaded(val.ToInt()) select new { When = val, Id = h.Id, Name = h.Name, LocationName = h.LocationType.Name }; return this.Json(forJSON.ToArray()); } else return null; } Here comes my JS code: <script type="text/javascript"> function commonMatch(selectedValue) { $("#selectedLocation").val(selectedValue); return this.When == selectedValue; }; function commonTemplate(item) { return "<option value='" + item.Id + "'>" + item.Name + "</option>"; }; $(document).ready(function() { $("#chained_child").cascade("#Countries", { ajax: { url: '/locations/getChildren' }, template: commonTemplate, match: commonMatch }).bind("loaded.cascade", function(e, target) { $(this).prepend("<option value='empty' selected='true'>------[%Select] Län------</option>"); $(this).find("option:first")[0].selected = true; }); $("#chained_sub_child").cascade("#chained_child", { ajax: { url: '/locations/getChildren' }, template: commonTemplate, match: commonMatch }).bind("loaded.cascade", function(e, target) { $(this).prepend("<option value='empty' selected='true'>------[%Select] Kommun------</option>"); $(this).find("option:first")[0].selected = true; }); $("#chained_sub_sub_child").cascade("#chained_sub_child", { ajax: { url: '/locations/getChildren' }, template: commonTemplate, match: commonMatch }).bind("loaded.cascade", function(e, target) { $(this).prepend("<option value='empty' selected='true'>------[%Select] Stad------</option>"); $(this).find("option:first")[0].selected = true; }); }); I added one condition to jquery.cascade.ext.js if (opt.getParentValue(parent) != "empty") $.ajax(_ajax); To prevent Ajax request without selected value, but I faced with problem, when I reset selection in first box 3d box and bellow does not refresh: And second issue: I would like to know where is best place to inject my own function that will do something, with one requirement - I need to know that all boxes finished work. If somebody worked within let me know maybe we could together find solution. Thanks in advice...

    Read the article

  • jQuery Light Box not loading in all system?

    - by Harish
    I am using jQuery's thickbox.js pluging, for a modal dialog box that will appear when some one first loads the website(as a welcome banner), and after clicking on "enter site" they should be logged in to my home page. But the problem is "Modal dialog box appear's to be empty in some system(i.e OS), with same configuration, and shows only the loading progress bar". it works in some system only.. please help to find the problem??

    Read the article

< Previous Page | 46 47 48 49 50 51 52 53 54 55 56 57  | Next Page >