Search Results

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

Page 62/935 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • not able to get a processed list in jquery variable

    - by Pradyut Bhattacharya
    I have html list <ol id="newlist"> <li>Test <ol> <li>1</li> <li>2</li> <li>3</li> </ol> </li> <li>Another test <ol> <li>1</li> </ol> </li> <li>Cool Test <ol> <li>1</li> <li>2</li> </ol> </li> </ol> Now i have hidden the list using the css... #newlist li { display:none; list-style: none; } I want to display the list and the only the descendants which have greater than 1 descendants... the output should be... Test 1 2 3 Another test Cool Test 1 2 I have used jquery and able to get the output... the code i used... $("ol#newlist > li").show(); for (var i = 0; i < $("ol#newlist > li").length; i++) { if ($("ol#newlist > li:eq(" + i + ") ol > li").length > 1) $("ol#newlist > li:eq(" + i + ") ol > li").show(); } the sample page here Now i want all the list in a single variable like i can get the lis in a variable... var $li = $("ol#newlist > li"); but the code $li.add($("ol#newlist > li:eq(" + i + ") ol > li")); is not working... the sample page here Please help... Thanks Pradyut India

    Read the article

  • incremental OL using letters (jQuery)

    - by jquery n00b
    Hi, I'm trying to dynamically add a span to an ol, where the counter should be in letters. eg: A result B result C result etc etc I've got this code which is great for using numbers but I've no idea what to do to it to make the numbers into letters jQuery(document).ready( function() { jQuery('.results ol').each(function () { jQuery(this).find('li').each(function (i) { i = i+1; jQuery(this).prepend('<span class="marker">' + i + '</span>'); }); }); }); Any help is greatly appreciated!

    Read the article

  • passing data from a client form via jquery ajax dinamicly

    - by quantum62
    i wanna insert specification of members that enter in textboxs of form in the database .i do this operation with jquery ajax when i call webmetod with static value the operation do successfully.for example this code is ok. $.ajax({ type: "POST", url:"MethodInvokeWithJQuery.aspx/executeinsert", data: '{ "username": "user1", "name":"john","family":"michael","password":"123456","email": "[email protected]", "tel": "123456", "codemeli": "123" }', contentType: "application/json; charset=utf-8", dataType: "json", async: true, cache: false, success: function (msg) { $('#myDiv2').text(msg.d); }, error: function (x, e) { alert("The call to the server side failed. " + x.responseText); } } ); but when i wanna use of values that enter in textboxes dynamically error occur.whats problem?i try this two code <script type="text/javascript"> $(document).ready( function () { $("#Button1").click( function () { var username, family, name, email, tel, codemeli, password; username = $('#<%=TextBox1.ClientID%>').val(); name = $('#<%=TextBox2.ClientID%>').val(); family = $('#<%=TextBox3.ClientID%>').val(); password = $('#<%=TextBox4.ClientID%>').val(); email = $('#<%=TextBox5.ClientID%>').val(); tel = $('#<%=TextBox6.ClientID%>').val(); codemeli = $('#<%=TextBox7.ClientID%>').val(); $.ajax( { type: "POST", url: "WebApplication20.aspx/executeinsert", data: "{'username':'username','name':name, 'family':family,'password':password, 'email':email,'tel':tel, 'codemeli':codemeli}", contentType: "application/json;charset=utf-8", dataType: "json", async: true, cache: false, success: function(msg) { alert(msg); }, error: function (x, e) { alert("The call to the server side failed. " + x.responseText); } } ); } ) }) </script> or $(document).ready( function () { $("#Button1").click( function () { var username, family, name, email, tel, codemeli, password; username = $('#<%=TextBox1.ClientID%>').val(); name = $('#<%=TextBox2.ClientID%>').val(); family = $('#<%=TextBox3.ClientID%>').val(); password = $('#<%=TextBox4.ClientID%>').val(); email = $('#<%=TextBox5.ClientID%>').val(); tel = $('#<%=TextBox6.ClientID%>').val(); codemeli = $('#<%=TextBox7.ClientID%>').val(); $.ajax( { type: "POST", url: "WebApplication20.aspx/executeinsert", data: '{"username" : '+username+', "name": '+name+', "family": '+family+', "password": '+password+', "email": '+email+', "tel": '+tel+' , "codemeli": '+codemeli+'}', contentType: "application/json;charset=utf-8", dataType: "json", async: true, cache: false, success: function(msg) { alert(msg); }, error: function (x, e) { alert("The call to the server side failed. " + x.responseText); } } ); } ) })

    Read the article

  • Jquery hover with animation

    - by Brian
    anyone know how to stop a .hover happening again before the mouseout animation has finished? I have the following code which has 4 anchors. Once hovered over the anchor the related anchor slides in using animation. My problem is you hover out and in quickly, before the square has been set back to 0px it increases the slide distance. <body class="home"> <div id="container"> <a class="page-link homet" id="anim-1"></a> <a class="page-link about" id="anim-2"></a> <a class="page-link portfolio" id="anim-3"></a> <a class="page-link contacts" id="anim-4"></a> <div id="header"> <div id="logo"> </div> <ul id="navigation"> <li><a id="1"></a></li> <li><a id="2"></a></li> <li><a id="3"></a></li> <li><a id="4"></a></li> </ul> </div> <div id="main"> <div id="left-content"> </div> <div id="main-content"> </div> </div> </div> </body> </html> Jquery var cc = { displayAnim : function () { actionLink = $("#container #header #navigation li a"); movePosition = "0"; $("#container a.page-link").css({ position:"absolute", right: 0}); $(actionLink).hoverIntent( function() { circleToReveal = $(this).attr('id'); switch (circleToReveal) { case "1" : movePostion = "386" break; case "2" : moveposition = "514" break; case "3" : movePosition = "643" break; case "4" : movePosition = "400" break; default : movePosition = "772" }; /* console.log(movePosition); */ $("#container #anim-" +circleToReveal+ "").stop().animate({"right": "+="+ movePosition +"px"}, "slow"); }, function() { $("#container #anim-" +circleToReveal+ "").stop().animate({"right": "-="+ movePosition +"px"}, "slow"); } ); } }; $(window).load (function () { $("body").addClass('js'); $("a.pagelink").hide(); cc.displayAnim(); });

    Read the article

  • Extract a portion of a Qt .ui file into its own .ui file

    - by Grant Limberg
    We have a designer creating a user interface for an application. The main window has several QStackedWidgets used for in place panel switching. What I'd like to be able to do is extract each individual panel that makes up each page of the QStackedWidget into it its own .ui file. Is there an easy way to accomplish this from within Qt Designer, or are there any other tools to help accomplish this task short of redesigning all of the panels in their own .ui files?

    Read the article

  • jQuery validation plugin addMethod firing incorrectly

    - by LoganEtherton
    I must be missing something obvious, but everything that I've tried for this is leaving me empty handed, so I'm a bit puzzled. I'm attempting to use the jQuery validation plugin with custom validation methods, but it seems to be hit or miss. It seems that I am able to successfully add rules to a certain extent, but some of the methods are not applied. Or the specified method is not applied, and the incorrect method is instead applied. So, for example, this works without a hitch: $.validator.addMethod("emailValidation", function(value, element) { return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/.test(value); }, "Please enter a valid email address." ); $.validator.addMethod("password", function(value, element) { return /[^\s]{6,25}/.test(value); }, "Please enter a password between 6 and 25 characters long." ); ... $(function(){ $("#registrationForm").validate({ rules: { email: { required: true, emailValidation: true }, password: { required: true, password: true }, } }); }); Both the password validation and email validation work. But then I add, in the same exact manner, a validation test for names. So, right below where the password method ends, I add: $.validator.addMethod("name", function(value, element) { return /[^\s]{6,25}/.test(value); }, "Please enter a valid name." ); Which turns the validate call into: $(function(){ $("#registrationForm").validate({ rules: { email: { required: true, emailValidation: true }, password: { required: true, password: true }, studentFirstName: { name: true } } }); }); And suddenly, everything is only validating for names. Both the email and password fields now validate using the name method, as does the name field. This is confusing! I've added console.log calls to all methods, and indeed, it's not that one is being called after the other - the only one being called is name. I've checked and double checked that the element selection is good. I've checked that everything is groovy with the methods themselves. Any ideas?

    Read the article

  • Select Elements in nested Divs using JQuery

    - by PIKP
    I have the following html markup inside a Div named item and I want to select all the elements (inside nested divs) and clear the values. As shown in following given Jquery I have managed to access elements in each Div by using.children().each(). But the the problem is .children().each()goes one level down at a time from the parent div, so I have repeated the same code block with multiple .children() to access the elements inside nested Divs, can anyone suggest me a method to do this without repeating the code for N number of nested divs . html markup <div class="item"> <input type="hidden" value="1234" name="testVal"> <div class="form-group" id="c1"> <div class="controls "> <input type="text" value="Results" name="s1" maxlength="255" id="id2"> </div> </div> <div class="form-group" id="id4"> <input type="text" value="Results" name="s12" maxlength="255" id="id225"> <div class="form-group" id="id41"> <input type="text" value="Results" name="s12" maxlength="255" id="5"> <div class="form-group" id="id42"> <input type="text" value="Results" name="s12" maxlength="255" id="5"> <div class="form-group" id="id43"> <input type="text" value="Results" name="s12" maxlength="255" id="id224"> </div> </div> </div> </div> </div> My Qjuery script var row = $(".item:first").clone(false).get(0); $(row).children().each(function () { updateElementIndex(this, prefix, formCount); if ($(this).attr('type') == 'text') { $(this).val(''); } if ($(this).attr('type') == 'hidden' && ($(this).attr('name') != 'csrfmiddlewaretoken')) { $(this).val(''); } if ($(this).attr('type') == 'file') { $(this).val(''); } if ($(this).attr('type') == 'checkbox') { $(this).attr('checked', false); } $(this).remove('a'); }); // Relabel or rename all the relevant bits $(row).children().children().each(function () { updateElementIndex(this, prefix, formCount) if ($(this).attr('type') == 'text') { $(this).val(''); } if ($(this).attr('type') == 'hidden' && ($(this).attr('name') != 'csrfmiddlewaretoken')) { $(this).val(''); } if ($(this).attr('type') == 'file') { $(this).val(''); } if ($(this).attr('type') == 'checkbox') { $(this).attr('checked', false); } $(this).remove('a'); });

    Read the article

  • jQuery upload file using jQuery's ajax method (without plugins)

    - by Daniil Harik
    Hello, At moment I want to implement picture upload without using any plug-ins. My upload form looks like this <form action="/Member/UploadPicture" enctype="multipart/form-data" id="uploadform" method="post"> <span style="display: none;"> <div class="upload" id="imgUpl"> <h3>Upload profile picture</h3> <div class="clear5"></div> <input type="file" name="file" id="file" /> <button class="btn-bl" id="upComplete"><span>Upload</span></button> </div> </span> </form> And my jQuery code is: $('#upComplete').click(function () { $('#up').hide(); $('#upRes').show(); var form = $("#uploadform"); $.ajax({ type: "POST", url: "/Member/UploadPicture", data: form.serialize(), success: function (data) { alert(data); } }); $.fancybox.close(); return false; }); If I open firebug, I can see that ajax() method does simple form post (not multi-part) and POST content is empty Is it possible to do files upload using jQuery ajax() method or should I do this in any other way? Thank You very much

    Read the article

  • jQuery add() function and the context of jQuery objects

    - by patrick
    Given the following HTML example... <div id='div1'>div one</div> <div id='div2'>div two</div> ...I found that the following jQuery code... $('#div1').click(function() { var $d = $(this); // Using 'this' instead of '#div1' $d.add('#div2').remove(); }); ...would not add #div2 to the set referenced by $d, but this code... $('#div1').click(function() { var $d = $('#div1'); // Using '#div1' instead of 'this' $d.add('#div2').remove(); }); ...successfully added #div2. Upon consulting firebug, I found that using $(this) gave the jQuery object a context of #div1, but doing $('#div1') gave the object a context of document. Given this information I tried... var $d = $(this, document); ...and the add() function worked as expected. So here's the question. Could someone please explain to my why a different context is assigned when using $(this) vs $('#div1')? Thanks much!

    Read the article

  • how can we store php variables in jquery variables in jquery part

    - by surya
    $('#b').bind('click',function(){ alert('hii'); var slide_start=slider_content.indexOf(0); if(slide_start==2) { $('#reg_rem_form').hide(); } var show=1+slide_start; var show_first='#'+show; **var value_to_insert=<?php echo $value;? >=$(show_first).val();** <?php /* 1. Date of birth 2. gender 3. Unvi1 4. Unvi2 5. highest degree unvi1 6. highest degree unvi2 7. Year of passing unvi1 8. Year of passing unvi2 9. Current working 10. Work experience */ ?> Just as we store php variables in jquery variables , same thing but in reverse i want to store jquery variables in php variables ??? The highlighted part is the main line. how to do that , above code giving me the error === missing ";" before statement. Is this right way to do this =$('#bold').val();

    Read the article

  • jQuery and jQuery UI (Dual Licensing)

    - by John Hartsock
    OK I have read many posts regarding Dual Licensing using MIT and GPL licenses. But Im curious still, as the wording seems to be inclusive. Many of the Dual Licenses state that the software is licensed using "MIT AND GPL". The "AND" is what confuses me. It seems to me that the word "AND" in the terms, means you will be licensing the product using both licenses. Most of the posts, here on stackoverflow, say you can license the software using one "OR" the other. JQuery specifically states "OR", whereas JQuery UI specifically States "AND". Another Instance of the "AND" would be JQGrid. Im not a lawyer but, it seems to me that a legal interpretation of this would state that use of the software would mean that your using the software under both licenses. Has anyone who has contacted a lawyer gotten clarification or a definitive answer as to what is true? Can you use Dual licensed software products that state "AND" in the terms of agreement under either license?

    Read the article

  • Using JQuery in an AJAX control and avoiding conflicts

    - by Rich Andrews
    Hi, I am using JQuery within a custom AJAX user control (part of a home grown toolkit) and I need to ensure that JQuery is present on the hosting page. There can be multiple instances of the control on a page and some controls may need to use different versions of JQuery. At the moment I am using the following code to load in JQuery when the control initializes... Page.ClientScript.RegisterClientScriptInclude(Page.GetType(), "jquery-1.4.4.min.js", this.ResolveUrl("TextControlPlugin/lib/jquery-1.4.4.min.js")); This works because the scriptmanager handles not putting multiple copies of the same script into he page. Problems... I cannot use JQuery statically in the calling page (I may not have a control on the page but need to use JQuery) The scriptmanager appears to handle only duplicate URL's and I will need to deploy it from potentially 2 different URL's (the calling page's copy and the controls copy) So, is there a way to isolate a version of JQuery to the context of my control that doesnt interfear with any use of JQuery from the calling page? The developer writing the page may not have access to the internals of the control. I have looked at JQuery.noConflict() but cannot seem to get it to work correctly - I believe I'm having problems with the order in which the scripts are injected into the page - I keep getting JQuery is undefined errors. Any help would be much appreciated

    Read the article

  • [jQuery UI - Accordion] Styling active header?

    - by RC
    Hi, Simple issue: I am using Accordion without any UI themes (just barebones, using my own CSS). So far, so good, except that I cannot figure out how to set an "active" style for the currently selected header. The jQuery code: $("#menu").accordion({ event:"mouseover",header:"a.top" }); The HTML code: <a href="#" class="top">XXX1</a> <div class="sub"> <a href="#">Subheading 1</a> <a href="#">Subheading 2</a> <a href="#">Subheading 3</a> </div> <a href="#" class="top">XXX2</a> <div class="sub"> <a href="#">Subheading 1</a> <a href="#">Subheading 2</a> <a href="#">Subheading 3</a> </div> This works great, except that I cannot find a way to define the styles for the active header without using ThemeRoller. Manually setting the following styles in my CSS has no effect: .ui-state-active .ui-widget-content .ui-state-active .ui-state-active a .ui-state-active a:link .ui-state-active a:visited Assistance, please?

    Read the article

  • jQuery trigger custom event synchronously?

    - by Miguel Angelo
    I am using the jQuery trigger method to call an event... but it behaves inconsistently. Sometimes it call the event, sometimes it does not. <a href="#" onclick=" $(this).trigger('custom-event'); window.location.href = 'url'; return false; ">text</a> The custom-event has lots of listeners added to it. It is as if the trigger method is not synchronous, allowing the window.location.href be changed before executing the events. And when window.location.href is changed a navigation occurs, interrupting everything. How can I trigger events synchronously? Using jQuery 1.8.1. Thanks! EDIT I have found that the event, when called has a stack trace like this: jQuery.fx.tick (jquery-1.8.1.js:9021) tick (jquery-1.8.1.js:8499) jQuery.Callbacks.self.fireWith (jquery-1.8.1.js:1082) jQuery.Callbacks.fire (jquery-1.8.1.js:974) jQuery.speed.opt.complete (jquery-1.8.1.js:8991) $.customEvent (myfile.js:28) This proves that jQuery trigger method is asynchronous. Oohhh my... =\

    Read the article

  • How to use Jquery UI in my Custom Function? (Autocomplete)

    - by bakazero
    I want to create a function to simplify configuration of jQuery UI AutoComplete. Here is my function code: (function($) { $.fn.myAutocomplete = function() { var cache = {}; var dataUrl = args.dataUrl; var dataSend = args.dataItem; $.autocomplete({ source: function(request, response) { if (cache.term == request.term && cache.content) { response(cache.content); } if (new RegExp(cache.term).test(request.term) && cache.content && cache.content.length < 13) { var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); response($.grep(cache.content, function(value) { return matcher.test(value.value) })); } $.ajax({ url: dataUrl, dataType: "json", type: "POST", data: dataSend, success: function(data) { cache.term = request.term; cache.content = data; response(data); } }); }, minLength: 2, }); } }) (jQuery); but when I'm using this function like: $("input#tag").myAutocomplete({ dataUrl: "/auto_complete/tag", dataSend: { term: request.term, category: $("input#category").val() } }); It's give me an error: Uncaught ReferenceError: request is not defined

    Read the article

  • ASP.NET MVC: Using jQuery context menu with tables

    - by DigiMortal
    I needed to add context menus to some tables of my intranet application. After trying some components I found one that does everything I need and has no overhead. In this posting I will show you how to use jQuery context menu plug-in and how to attach it to tables. I found context menu plug-in by Chris Domigan and it was very easy to integrate to my application (when comparing some other plug-ins that work only on demo pages and in simple scenarios). Thanks, Chris, for great work! Now let’s use this context menu plug-in with table. Before we go on let’s see what we are trying to achieve. The following screenshot fragment shows simple context menu that we want to attach to our table. And when we click some menu option then something should happen too. :) Installing context menu plug-in Download plug-in (if download link is broken then open demo page and I think you know how to get plug-in from there). Copy jquery.contextmenu.js to your scripts folder. Include it in your masterpage or in the page where you plan to use context menus. Make sure plug-in is included correctly (use Firebug or some other tool you like). Save the page. Defining context menu Now let’s define context menu. Here is fragment on context menu definition from my code. <div class="contextMenu" id="myMenu1">     <ul>     <li id="email"><img src="/img/e-mail.png" />E-mail</li>     <li id="homepage"><img src="/img/homepage.png" />Homepage</li>     </ul> </div> div with id myMenu1 is container of context menu. Unordered list inside container defines items in context menu – simple and elegant! Adding context menu to table I have table with persons. It is simple HTML. I omitted commands column from this and the next table to keep them simple and more easily readable. <table>   <tr>     <th>Name</th>     <th>Short</th>     <th>Address</th>     <th>Mobile</th>     <th>E-mail</th>   </tr>   <% foreach(var person in Model.Results) { %>   <tr>     <td><%=person.FullName %></td>     <td><%=person.ShortName %></td>     <td><%=person.FullAddress %></td>     <td><%=person.Mobile %></td>     <td><%=person.Email %></td>   </tr>   <% } %> </table> To get context menu linked to table rows first cells we need to specify class for cells and ID. We need ID because we have to know later which ID has the row on which user selected something from context menu. <table>   <tr>     <th>Name</th>     <th>Short</th>     <th>Address</th>     <th>Mobile</th>     <th>E-mail</th>   </tr>   <% foreach(var person in Model.Results) { %>   <tr>     <td class="showContext" id="<%= person.Id %>"><%=person.FullName %></td>     <td><%=person.ShortName %></td>     <td><%=person.FullAddress %></td>     <td><%=person.Mobile %></td>     <td><%=person.Email %></td>   </tr>   <% } %> </table> Now we have only one thing to do – we have to write some code that attaches context menu to table cells. Catching context menu events Now we will make everything work. Relax, it is only couple of lines of code, thank to jQuery. <script type="text/javascript">   $(document).ready(function () {     $('td.showContext').contextMenu('myMenu1', {         bindings: {         'email': function (t) {           document.location.href = '/contact/sendmail/' + t.id;         },         'homepage': function (t) {           document.location.href = '/contact/homepage/' + t.id;         }       }     });   }); </script> I think that first lines doesn’t need any comments. Take a look at bindings. We gave ID to table cells because it is carried also to bound events. We can use also more complex ID-s if we have more than one table with context menus on our form. Now we are done. Save all files, compile solution, run it and try out how context menu works. Conclusion We saw than using jQuery with context menu component allows us easily create powerful context menus for our user interfaces. Context menu was very easy to define. We were also able to attach context menu to table and use ID of current row entity also in events of context menu. To achieve this we needed only some minor modifications in view and couple of lines of JavaScript.

    Read the article

  • Where does jQuery fit-in with frameworks like JavaScriptMVC, BackboneJS, SproutCore and Knockout?

    - by Prisoner ZERO
    I have been happily using JQuery for the last 2 years and have been quite sucessful creating some really cool functionality with it...so I am very comfortable with it. I also beleive the future of the web will continue on the current client-side path. However... The next challenge seems to be coming in the form of various controller frameworks: KnockoutJS, BackboneJS, SproutCore, JavaScriptMVC (the list goes on). Additonally, there are some great AMD Loader tools for use like RequireJS or LabJS etc. However, jQuery now has define and then capabilities baked-in. It's getting harder-and-harder to keep track of it all... And now, my task seems to be to evaluate/decide-on a strategic-direction for using some form of either an MVC or MVVM framework client-side...but I have so many questions. Where does JQuery fit-in with the various controller-frameworks mentioned above? Is JQuery used alongside each or do some of them have their own 'JQuery-styled version' baked-in? Are tools like RequireJS still needed if you implement one of the various controller-frameworks mentioned above? Does the define and then capabilities baked-into JQuery now supercede the AMD Loader mentioned above? Which one seems most modular? (see notes below) NOTES: One thing I don't want in any future-framework is the requirement of having to take-in vast amounts of functionality that I don't use. Meaning, I would rather use a framework that is truly modular. For example, to use jQuery UI you have to take-in a lot other core libraries that you might not actually use. I will be experimenting with each one, but some REAL feedback would be great. I've seen some 'similar' questions, but none have really answered the above skew. Thanks in advance!

    Read the article

  • Issue with image lightbox and enlargement / Jquery Mobile

    - by Matt
    I'm working on a redesign of my weather website using Jquery Mobile. I have it set up so that you drill down through a series of content containers to get to the weather info (each group of info opens in a dialog display). Everything's worked well, but I've run into an issue with my images. I have them sized so that they fit a mobile device's screen nicely, but because of that, when you look at them in a desktop browser, you can't really make out what the image is. I've tried several image lightbox / enlargement solutions, but for some reason, none of them have worked. Either nothing happens or the images open in a new window. I thought that this might be caused by Jquery Mobile somehow overwriting the scripts and css of the lightbox / enlargements I've tried. I'm not completely sure though that this is the case, and if it is, how I can get around it to be able to enlarge the images to their original size, preferably onclick. Here is a working (for the most part - still some kinks to work out) example. If you look under the "Tropical" section at the "Satellite-Derived Products", you'll see what I mean. http://www.suncoaststormwatch.com/Beta/Index.html

    Read the article

  • How to create repeatable table with unique ID's using jQuery

    - by milbert
    I need to create a table structure that can be "copied" and populated with a new set of data. However, each table must have unique IDs for functions that must access them later. For example: <table class="main"> <thead><tr><th class="header"></th></tr></thead> <tbody> <tr class="row"><td class="col0"></td><td class="col1"></td></tr> </tbody> </table> My current thought is to use jQuery to load the table from a seperate html file into a variable. Using this saved table I could then create a function that copies it, traverses the table to add an ID to each section where information will need to be appended from a seperate data source, and return this new table. I am new to jQuery and feel like I may be missing an easier/better way to accomplish this. Any help on this subject would be appreciated.

    Read the article

  • How to move child element from one parent to another using jQuery

    - by Kapslok
    I am using the jQuery DataTables plugin. I would like to move the search box (.dataTables_filter) and number of records to display dropdown (.dataTables_length) from their parent element (.dataTables_wrapper) to another div on my page without losing any registered javascript behavior. For instance the search box has a function attached to the 'keyup' event and I want to keep that intact. The DOM looks like this: <body> <div id="parent1"> <div class="dataTables_wrapper" id="table1_wrapper"> <div class="dataTables_length" id="table1_length"> <select size="1" name="table1_length"> <option value="10">10</option> <option value="25">25</option> <option value="50">50</option> <option value="100">100</option> </select> </div> <div class="dataTables_filter" id="table1_filter"> <input type="text" class="search"> </div> <table id="table1"> ... </table> </div> </div> <div id="parent2"> <ul> <li><a href="#">Link A</a></li> <li><a href="#">Link B</a></li> <li><a href="#">Link C</a></li> </ul> </div> </body> This is what I would like the DOM to look like after the move: <body> <div id="parent1"> <div class="dataTables_wrapper" id="table1_wrapper"> <table id="table1"> ... </table> </div> </div> <div id="parent2"> <div class="dataTables_filter" id="table1_filter"> <input type="text" class="search"> </div> <div class="dataTables_length" id="table1_length"> <select size="1" name="table1_length"> <option value="10">10</option> <option value="25">25</option> <option value="50">50</option> <option value="100">100</option> </select> </div> <ul> <li><a href="#">Link A</a></li> <li><a href="#">Link B</a></li> <li><a href="#">Link C</a></li> </ul> </div> </body> I've been looking at the .append(), .appendTo(), .prepend() and .prependTo() functions but haven't had any luck with these in practice. I've also looked at the .parent() and .parents() functions, but can't seem to code a workable solution. I have also considered changing the CSS so that the elements are absolutely positioned - but to be frank the page is setup with fluid elements all over, and I really want these elements to be floated in their new parents. Any help with this is much appreciated.

    Read the article

  • jQuery custom validation for a selected radio selection

    - by Kaushik Gopal
    Hey peeps, This is my requirement: I have a bunch of radio box selections (types of workflows). If one of the radios are selected(i.e one particular type of workflow selected), I want to run a custom validation on that. This is what i tried, but it's not behaving well. Any help? jQuery part: $(document).ready(function() { // this part is to expand the child radio selection if particular parent workflow selected $("#concernedDirectorChoice").hide(); $("input[name^=workflowChoice]").change( function (){ if($(this).attr("class")=='chooseDir'){ $("#concernedDirectorChoice").show(); }else{ $("#concernedDirectorChoice").hide(); } }); // FORM VALIDATION $.validator.addMethod("dirRequired", function(value, element) { return this.optional(element) || ($("input[name^=rdDir:checked]").length); }, "That particular workflow requires a Director to be chosen. Please select Director"); $("#contExpInitiateForm").validate({ debug:true ,rules:{ RenewalNo: {required: true, number: true}, chooseDir: {dirRequired: true}, workflowChoice: {required: true} } ,errorPlacement: function(error, element) { $('.errorMessageBox').text(error.html()); } }); }); HTML form part: <!-- Pick type of workflow --> <table class="hr-table" > <tr> <td class="hr-table-label " colspan=2 >Pick Workflow Type</td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="1"> </input> </td> <td> Workflow 1 </td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="2" class="chooseDir"> </input> </td> <td> Workflow 2 (Dir selection required) </td> </tr> <tr> <td> <input type="radio" name="workflowChoice" value="3"> </input> </td> <td> Workflow 3 </td> </tr> </table> <!-- Pick Director for Workflow type 2 --> <table id="concernedDirectorChoice" name="concernedDirectorChoice" > <tr><td class="hr-table-label" colspan=2 > Choose Concerned Director</td></tr> <tr> <td><input type="radio" value='Dir1' name="rdDir" /></td> <td>Director 1</td> </tr> <tr> <td><input type="radio" value='Dir2' name="rdDir" /></td> <td>Director 2</td> </tr> <tr> <td><input type="radio" value='Dir3' name="rdDir" /></td> <td>Director 3</td> </tr> </table>

    Read the article

  • Use JQuery to target unwrapped text inside a div

    - by Chris
    I'm trying to find a way to wrap just the inner text of an element, I don't want to target any other inner dom elements. For example. <ul> <li class="this-one"> this is my item <ul> <li> this is a sub element </li> </ul> </li> </ul> I want to use jQuery to do this. <ul> <li class="this-one"> <div class="tree-item-text">this is my item</div> <ul> <li> <div class="tree-item-text">this is a sub element</div> </li> </ul> </li> </ul> A little background is I need to make an in-house tree structure ui element, So I'm using the UL structure to represent this. But I don't want developers to have to do any special formatting to use the widget. update: I just wanted to add the purpose of this is I want to add a click listener to be able to expand the elements under the li, However, since those elements are within the li the click listener will activate even when clicking on the children, So I want to attach it to the text instead, to do this the text needs to be targetable, which is why I want to wrap it in a div of it's own. So far I've come up with wrapping all the inner elements of the li in a div and then moving all inner dom elements back to the original parent. But this code is pretty heavy for something that might be much simpler and not require so much DOM manipulation. EDIT: Want to share the first pseudo alternative I came up with but I think it is very tasking for what I want to accomplish. var innerTextThing = $("ul.tree ul").parents("li").wrapInner("<div class='tree-node-text'>"); $(innerTextThing.find(".tree-node-text")).each(function(){ $(this).after($(this).children("ul")); }); Answered: I ended up doing the following, FYI i only have to worry about FF and IE compatibility so it's untested in other browsers. //this will wrap all li textNodes in a div so we can target them. $(that).find("li").contents() .filter(function () { return this.nodeType == 3; }).each(function () { if ( //these are for IE and FF compatibility (this.textContent != undefined && this.textContent.trim() != "") || (this.innerText != undefined && this.innerText.trim() != "") ) { $(this).wrap("<div class='tree-node-text'>"); } });

    Read the article

  • jQuery Scrollable Dynamic

    - by Coron3r
    Hi, I am doing a site where I need to change dynamically the amount of items in one slide depending on the resolution. I'm using the Jquery Tools scrollable For better understanding, here is the basic markup <div class="scrollable"> <!-- root element for the items --> <div class="items"> <!-- 1-5 --> <div> <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" /> <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" /> <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" /> <img src="http://farm1.static.flickr.com/28/66523124_b468cf4978_t.jpg" /> <img src="http://farm1.static.flickr.com/164/399223606_b875ddf797_t.jpg" /> </div> <!-- 5-10 --> <div> <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" /> <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" /> <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" /> <img src="http://farm1.static.flickr.com/153/399232237_6928a527c1_t.jpg" /> <img src="http://farm1.static.flickr.com/50/117346182_1fded507fa_t.jpg" /> </div> <!-- 10-15 --> <div> <img src="http://farm4.static.flickr.com/3629/3323896446_3b87a8bf75_t.jpg" /> <img src="http://farm4.static.flickr.com/3023/3323897466_e61624f6de_t.jpg" /> <img src="http://farm4.static.flickr.com/3650/3323058611_d35c894fab_t.jpg" /> <img src="http://farm4.static.flickr.com/3635/3323893254_3183671257_t.jpg" /> <img src="http://farm4.static.flickr.com/3624/3323893148_8318838fbd_t.jpg" /> </div> </div> </div> Ok and now I would like to set, that if I have a resolution bellow 1440, I would show only e.g. 3 images <div class="scrollable"> <!-- root element for the items --> <div class="items"> <!-- 1-3 --> <div> <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" /> <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" /> <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" /> </div> <!-- 3-6 --> <div> <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" /> <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" /> <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" /> </div> ..etc </div> </div> I know that I should use the screen.width(); function but how to slice and parse it depending on the resolution? Thanks for your comments!

    Read the article

  • jQuery Cycle Plugin - Content not cycling

    - by fmz
    I am setting up a page with jQuery's Cycle plugin and have four divs set to fade. I have the code in place, the images set, but it doesn't cycle properly. Firefox says there is a problem with the following code: <script type="text/javascript"> $(document).ready(function() { $('.slideshow').cycle({ fx: 'fade' }); }); </script> Here is the html: <div class="slideshow"> <div id="mainImg-1" class="slide"> <div class="quote"> <h2>Building Big Relationships with Small Business.</h2> <p>&ldquo;This is quote Number One.<br /> They are there when I need them the most.&rdquo;</p> <p><span class="author">Jane Doe &ndash; Charlotte Flower Shop</span></p> <div class="help"><a href="cb_services.html">Let Us Help You</a></div> </div> </div> <div id="mainImg-2" class="slide"> <div class="quote"> <h2>Building Big Relationships with Small Business.</h2> <p>&ldquo;This is quote Number Two.<br /> They are there when I need them the most.&rdquo;</p> <p><span class="author">Jane Doe &ndash; Charlotte Flower Shop</span></p> <div class="help"><a href="cb_services.html">Let Us Help You</a></div> </div> </div> <div id="mainImg-3" class="slide"> <div class="quote"> <h2>Building Big Relationships with Small Business.</h2> <p>&ldquo;This is quote Number three.<br /> They are there when I need them the most.&rdquo;</p> <p><span class="author">Jane Doe &ndash; Charlotte Flower Shop</span></p> <div class="help"><a href="cb_services.html">Let Us Help You</a></div> </div> </div> <div id="mainImg-4" class="slide"> <div class="quote"> <h2>Building Big Relationships with Small Business.</h2> <p>&ldquo;This is quote Number Fout.<br /> They are there when I need them the most.&rdquo;</p> <p><span class="author">Jane Doe &ndash; Charlotte Flower Shop</span></p> <div class="help"><a href="cb_services.html">Let Us Help You</a></div> </div> </div> Here is the CSS: .slideshow { width: 946px; height: 283px; border: 1px solid #c29c5d; margin: 8px; overflow: hidden; z-index: 1; } #mainImg-1 { width: 946px; height: 283px; background: url(../_images/main.jpg) no-repeat 9px 9px; } #mainImg-2 { width: 946px; height: 283px; background: url(../_images/main.jpg) no-repeat 9px 9px; } #mainImg-3 { width: 946px; height: 283px; background: url(../_images/main.jpg) no-repeat 9px 9px; } #mainImg-4 { width: 946px; height: 283px; background: url(../_images/main.jpg) no-repeat 9px 9px; } #mainImg-1 .quote, #mainImg-2 .quote, #mainImg-3 .quote, #mainImg-4 .quote { width: 608px; height: 168px; float: right; margin: 80px 11px 0 0; background: url(../_images/bg_quoteBox.png) repeat-x; } Before you go off and say, "hey, those images are all the same". You are right, the images are all the same right now, but the text should be rotating as well and there is a slight difference there. In addition, the fade should still show up. Anyway, you can see the dev page here: http://173.201.163.213/projectpath/first_trust/index.html I would appreciate some help to get this cycling through as it should. Thanks!

    Read the article

  • PHP, MySQL, jQuery, AJAX: json data returns correct response but frontend returns error

    - by Devner
    Hi all, I have a user registration form. I am doing server side validation on the fly via AJAX. The quick summary of my problem is that upon validating 2 fields, I get error for the second field validation. If I comment first field, then the 2nd field does not show any error. It has this weird behavior. More details below: The HTML, JS and Php code are below: HTML FORM: <form id="SignupForm" action=""> <fieldset> <legend>Free Signup</legend> <label for="username">Username</label> <input name="username" type="text" id="username" /><span id="status_username"></span><br /> <label for="email">Email</label> <input name="email" type="text" id="email" /><span id="status_email"></span><br /> <label for="confirm_email">Confirm Email</label> <input name="confirm_email" type="text" id="confirm_email" /><span id="status_confirm_email"></span><br /> </fieldset> <p> <input id="sbt" type="button" value="Submit form" /> </p> </form> JS: <script type="text/javascript"> $(document).ready(function() { $("#email").blur(function() { var email = $("#email").val(); var msgbox2 = $("#status_email"); if(email.length > 3) { $.ajax({ type: 'POST', url: 'check_ajax2.php', data: "email="+ email, dataType: 'json', cache: false, success: function(data) { if(data.success == 'y') { alert('Available'); } else { alert('Not Available'); } } }); } return false; }); $("#confirm_email").blur(function() { var confirm_email = $("#confirm_email").val(); var email = $("#email").val(); var msgbox3 = $("#status_confirm_email"); if(confirm_email.length > 3) { $.ajax({ type: 'POST', url: 'check_ajax2.php', data: 'confirm_email='+ confirm_email + '&email=' + email, dataType: 'json', cache: false, success: function(data) { if(data.success == 'y') { alert('Available'); } else { alert('Not Available'); } } , error: function (data) { alert('Some error'); } }); } return false; }); }); </script> PHP code: <?php //check_ajax2.php if(isset($_POST['email'])) { $email = $_POST['email']; $res = mysql_query("SELECT uid FROM members WHERE email = '$email' "); $i_exists = mysql_num_rows($res); if( 0 == $i_exists ) { $success = 'y'; $msg_email = 'Email available'; } else { $success = 'n'; $msg_email = 'Email is already in use.</font>'; } print json_encode(array('success' => $success, 'msg_email' => $msg_email)); } if(isset($_POST['confirm_email'])) { $confirm_email = $_POST['confirm_email']; $email = ( isset($_POST['email']) && trim($_POST['email']) != '' ? $_POST['email'] : '' ); $res = mysql_query("SELECT uid FROM members WHERE email = '$confirm_email' "); $i_exists = mysql_num_rows($res); if( 0 == $i_exists ) { if( isset($email) && isset($confirm_email) && $email == $confirm_email ) { $success = 'y'; $msg_confirm_email = 'Email available and match'; } else { $success = 'n'; $msg_confirm_email = 'Email and Confirm Email do NOT match.'; } } else { $success = 'n'; $msg_confirm_email = 'Email already exists.'; } print json_encode(array('success' => $success, 'msg_confirm_email' => $msg_confirm_email)); } ?> THE PROBLEM: As long as I am validating the $_POST['email'] as well as $_POST['confirm_email'] in the check_ajax2.php file, the validation for confirm_email field always returns an error. With my limited knowledge of Firebug, however, I did find out that the following were the responses when I entered email and confirm_email in the fields: RESPONSE 1: {"success":"y","msg_email":"Email available"} RESPONSE 2: {"success":"y","msg_email":"Email available"}{"success":"n","msg_confirm_email":"Email and Confirm Email do NOT match."} Although the RESPONSE 2 shows that we are receiving the correct message via msg_confirm_email, in the front end, the alert 'Some error' is popping up (I have enabled the alert for debugging). I have spent 48 hours trying to change every part of the code wherever possible, but with only little success. What is weird about this is that if I comment the validation for $_POST['email'] field completely, then the validation for $_POST['confirm_email'] field is displaying correctly without any errors. If I enable it back, it is validating email field correctly, but when it reaches the point of validating confirm_email field, it is again showing me the error. I have also tried renaming success variable in check_ajax2.php page to other different names for both $_POST['email'] and $_POST['confirm_email'] but no success. I will be adding more fields in the form and validating within the check_ajax2.php page. So I am not planning on using different ajax pages for validating each of those fields (and I don't think it's smart to do it that way). I am not a jquery or AJAX guru, so all help in resolving this issue is highly appreciated. Thank you in advance.

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >