Search Results

Search found 17146 results on 686 pages for 'jquery'.

Page 5/686 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • jQuery scrollTop not working in chrome but working in Firefox

    - by Maju
    I have used a scrollTop function in jquery for navigating to top. But strangely 'The smooth animated scroll' stopped working in safari and chrome(scrolling without smooth animation) after I made some changes. But it is working smoothly in Firefox. What could be wrong? Here is the jquery function i used, jQuery $('a#gotop').click(function() { $("html").animate({ scrollTop: 0 }, "slow"); //alert('Animation complete.'); //return false; }); HTML <a id="gotop" href="#">Go Top </a> CSS #gotop { Cursor: pointer; position: relative; float:right; right:20px; /*top:0px;*/ }

    Read the article

  • Listening and firing events with Javascript and maybe jQuery

    - by at
    In my Javascript and Flex applications, users often perform actions that I want other Javascript code on the page to listen for. For example, if someone adds a friend. I want my Javascript app to then call something like triggerEvent("addedFriend", name);. Then any other code that was listening for the "addedFriend" event will get called along with the name. Is there a built-in Javascript mechanism for handling events? I'm ok with using jQuery for this too and I know jQuery makes extensive use of events. But with jQuery, it seems that its event mechanism is all based around elements. As I understand, you have to tie a custom event to an element. I guess I can do that to a dummy element, but my need has nothing to do with DOM elements on a webpage. Should I just implement this event mechanism myself?

    Read the article

  • setting min date in jquery datepicker

    - by user1184777
    Hi i want to set min date in my jquery datepicker to (1999-10-25) so i tried the below code its not working. $(function () { $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd', showButtonPanel: true, changeMonth: true, changeYear: true, showOn: "button", buttonImage: "images/calendar.gif", buttonImageOnly: true, minDate: new Date(1999, 10 - 1, 25), maxDate: '+30Y', inline: true }); }); ** if i change the min year to above 2002 than it will work fine but if i specify min year less than 2002{like above eexample 1999} it will show only up to 2002.can someone help me. i am using jquery-1.7.1.min.js and jquery-ui-1.8.18.custom.min.js.

    Read the article

  • jquery sortable problem with ie

    - by corroded
    i am using jquery to sort my lists and i have run into a dead end. First, I checked the jquery site if theirs work on ie7, thats great, it does. next, i checked mine without the styles(so there possibly wont be anything that's intercepting or affecting jquery stuff). but i still get this weird error in ie7 when you sort items in the inner list(i have nested lists) they overlap each other, destroying the layout. if you sort the contianer lists, they work fine! here's a jsfiddle of what i mean: http://jsfiddle.net/GDUpa/ note that if you drag demonstration one or two spots(in ie), it will overlap with the other links. BUT if you drag POC (it will select the whole thing including the links under it), it works fine! is something wrong with my markup?

    Read the article

  • Extending a jquery plugins event callback

    - by Greg J
    I'm extending the functionality of a jquery plugin (foo) with another jquery plugin (bar). Essentially, the first plugin specifies an onReady(): var foo = $.foo({ onReady: function() { alert('foo'); }}); Foo is sent to bar as a parameter to bar: var bar = $.bar(foo); I want bar to be able to hook into foo's onReady event: (function($) { $.extend({ bar: function(foo) { var foo = foo; // How to do alert('bar') when foo.onready is called? } }); })(jQuery); I can override foo's onready event: foo.onready = function() { alert('bar'); } But I don't want to override it, I want to extend it so that I'll see both alerts when foo is ready. Thanks in advance!

    Read the article

  • jQuery Samples

    - by dwahlin
    Here are the jsfiddle samples that John Papa and I covered in our jQuery Fundamentals workshop at DevConnections last week. These were a few of the samples we wrote on the fly (so they’re not “perfect”) using http://jsfiddle.net and wanted to share. Additional jQuery samples covering selectors, DOM manipulation, Ajax techniques, as well as sample applications can be found here. You can also view the talks John gave at the conference here.  Code and slides from my talks can be found at the following links: Building the Account at a Glance ASP.NET MVC, EF Code First, HTML5, and jQuery Application Techniques, Strategies, and Patterns for Structuring JavaScript Code Getting Started Building Windows 8 HTML/JavaScript Metro Apps If you’re interested in learning more about jQuery check out my jQuery Fundamentals course at Pluralsight.com. Using the Data Function   Using Object Literals with jQuery   Using jQuery each() with string concatenation   Using on() to handle child events   jQuery - hover   jQuery - event handling variations   jQuery - Twitter (bind, append, appendTo, each, fadeOut, $.getJSON, callback, success, error, complete)r   jQuery - attr vs prop   jQuery - Simple selectors

    Read the article

  • jQuery show "loading" during slow operation

    - by The Disintegrator
    I'm trying to show a small loading image during a slow operation with jQuery and can't get it right. It's a BIG table with thousands of rows. When I check the "mostrarArticulosDeReferencia" checkbox it removes the "hidden" class from these rows. This operation takes a couple of seconds and I want to give some feedback. "loading" is a div with a small animated gif Here's the full code jQuery(document).ready(function() { jQuery("#mostrarArticulosDeReferencia").click(function(event){ if( jQuery("#mostrarArticulosDeReferencia").attr("checked") ) { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").removeClass("hidden"); //slow operation jQuery("#loading").hide(); } else { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").addClass("hidden"); //slow operation jQuery("#loading").hide(); } }); jQuery("#loading").hide(); }); It looks like jquery is "optimizing" those 3 lines jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").removeClass("hidden"); jQuery("#loading").hide(); And never shows the loading div. Any Ideas? Bonus: There is a faster way of doing this show/hide thing? Found out that toggle is WAY slower. UPDATE: I tried this jQuery("#mostrarArticulosDeReferencia").click(function(event){ if( jQuery("#mostrarArticulosDeReferencia").attr("checked") ) { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").removeClass("hidden"); //slow operation setTimeout("jQuery('#loading').hide()", 1000); } else { jQuery("#loading").show(); //not showing jQuery("#listadoArticulos tr.r").addClass("hidden"); //slow operation setTimeout("jQuery('#loading').hide()", 1000); } }); That's what I get click on checkbox nothing happens during 2/3 secs (processing) page gets updated loading div shows up during a split second UPDATE 2: I've got a working solution. But WHY I have to use setTimeout to make it work is beyond me... jQuery("#mostrarArticulosDeReferencia").click(function(event){ if( jQuery("#mostrarArticulosDeReferencia").attr("checked") ) { jQuery("#loading").show(); setTimeout("jQuery('#listadoArticulos tr.r').removeClass('hidden');", 1); setTimeout("jQuery('#loading').hide()", 1); } else { jQuery("#loading").show(); setTimeout("jQuery('#listadoArticulos tr.r').addClass('hidden');", 1); setTimeout("jQuery('#loading').hide()", 1); } });

    Read the article

  • bing maps in jquery dialog context menu

    - by lucky
    I have a main form, which has button. By clicking on this button JQuery Dialog will shown. And contains of this dialog is a javascript bing map (using VEMAP object). So there are different js documents. How can I create a context menu for bing map, opening in jquery dialog? Thanks!

    Read the article

  • jQuery .ajax success function not rendering html with jQuery UI elements.

    - by tylerpenney
    How do I have the html loaded into my div from the .ajax render with jquery? the success function loads the HTML, but those elements do not show up as jQuery UI elements, just the static HTML types. Any pointers? $(function() { $('input[type=image]').click(function(){ $.ajax({ url: '_includes/callinfo.php', data: 'id=' + $(this).attr('value'), dataType: "html", success: function(html){ $('#callwindow').html(html); } }); }); });

    Read the article

  • jQuery block UI exceptions

    - by Chirantan
    I am using JQuery UI plugin blockUI to block UI for every ajax request. It works like a charm, however, I don't want to block the UI (Or at least not show the "Please wait" message) when I am making ajax calls to fetch autocomplete suggest items. How do I do that? I am using jquery autocomplete plugin for autocomplete functionality. Is there a way I can tell the block UI plug-in to not block UI for autocomplete?

    Read the article

  • jQuery UI datepicker customization

    - by Chad
    I have the jQuery datepicker working, but I need to be able to select more than just dates. I need to be able to select between some strings as well "Yesterday" and "Today" to be precise. So, the underlying input can contain any date as well as the strings "Yesterday" or "Today". Is there some way I can do this by tweaking the existing jQuery UI datepicker?

    Read the article

  • Loading jQuery plugin defaults from the server (AJAX)

    - by Pablo
    Im working on a private jQuery plugin in the following format: (function( $ ){ var defaults = {}; $.fn.cmFlex = function(opts) { this.each(function() { //Element specific options var o = $.extend({}, defaults, opts); //Code here }); //code Here }; })( jQuery ); How will i go on loading the default options from the server before $.cmFlex() is first called?

    Read the article

  • Jquery ui sortable clone helper not working

    - by Jeremy Seekamp
    Maybe I don't understand how clone works with sortable, but here is what I would like to do. When sorting an item I would like a clone of the item I am dragging remain until I stop drop the item in its new position. Here's the code: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script> <style type="text/css"> .sort { width: 150px; } .ui-state-highlight { background-color: #000; height:2px; } </style> </head> <body> <div> <ul class="sort"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> </ul> </div> <script type="text/javascript"> $(function() { $('.sort').sortable({ helper: 'clone', placeholder: 'ui-state-highlight', opacity: '.5' }) }) </script> </body> </html> Thanks in advance for the help!

    Read the article

  • JQuery UI Autocomplete showing as bullets

    - by awshepard
    The JQuery UI Demo page for autocomplete (link) has a nice looking search box and drop down with nice colors and highlights and such. When I implement it for myself, I end up with a bulleted list. How do I get my drop down of suggestions to look like theirs? A few notes/code fragments: I'm working in .NET land, so I'm using the <asp:ScriptManager> tag with <asp:ScriptReference>s inside it to get the hosted jquery.min.js (1.4.2) and jquery-ui.min.js (1.8.1) files from Google. My input box is fairly simple: <div class='ui-widget'> <label for="terms">Term: </label> <input id="terms" class="ui-autocomplete-input"> </div> My autocomplete looks like: $(""#terms"").autocomplete({source:""GetAttributesJSON.aspx"",minLength:2}); I get the correct data back, so that's not the issue. I just want fancy graphics. Any thoughts would be much appreciated.

    Read the article

  • .post inside jQuery.validator.addMethod always returns false :(

    - by abdullah kahraman
    Hello! I am very new to jQuery and javascript programming. I have a program below that checks whether username is taken or not. For now, the PHP script always returns if(isset($_POST["username"]) )//&& isset($_POST["checking"])) { $xml="<register><message>Available</message></register>"; echo $xml; } Login function works, but username checking doesn't. Any ideas? Here is all of my code: $(document).ready(function() { jQuery.validator.addMethod("checkAvailability",function(value,element){ $.post( "login.php" , {username:"test", checking:"yes"}, function(xml){ if($("message", xml).text() == "Available") return true; else return false; }); },"Sorry, this user name is not available"); $("#loginForm").validate({ rules: { username: { required: true, minlength: 4, checkAvailability: true }, password:{ required: true, minlength: 5 } }, messages: { username:{ required: "You need to enter a username." , minlength: jQuery.format("Your username should be at least {0} characters long.") } }, highlight: function(element, errorClass) { $(element).fadeOut("fast",function() { $(element).fadeIn("slow"); }) }, success: function(x){ x.text("OK!") }, submitHandler: function(form){send()} }); function send(){ $("#message").hide("fast"); $.post( "login.php" , {username:$("#username").val(), password:$("#password").val()}, function(xml){ $("#message").html( $("message", xml).text() ); if($("message", xml).text() == "You are successfully logged in.") { $("#message").css({ "color": "green" }); $("#message").fadeIn("slow", function(){location.reload(true);}); } else { $("#message").css({ "color": "red" }); $("#message").fadeIn("slow"); } }); } $("#newUser").click(function(){ return false; }); });

    Read the article

  • Automatically resize jQuery UI dialog to the width of the content loaded by ajax

    - by womp
    I'm having a lot of trouble finding specific information and examples on this. I've got a number of jQuery UI dialogs in my application attached to divs that are loaded with .ajax() calls. They all use the same setup call: $(".mydialog").dialog({ autoOpen: false, resizable: false, modal: true }); I just want to have the dialog resize to the width of the content that gets loaded. Right now, the width just stays at 300px (the default) and I get a horizontal scrollbar. As far as I can tell, "autoResize" is no longer an option for dialogs, and nothing happens when I specify it. I'm trying to not write a separate function for each dialog, so .dialog("option", "width", "500") is not really an option, as each dialog is going to have a different width. Specifying width: 'auto' for the dialog options just makes the dialogs take up 100% of the width of the browser window. What are my options? I'm using jQuery 1.4.1 with jQuery UI 1.8rc1. It seems like this should be something that is really easy. EDIT: I've implemented a kludgy workaround for this, but I'm still looking for a better solution.

    Read the article

  • jQuery capture all changes to named inpt on a form

    - by Brian M. Hunt
    I'm trying to determine when any of a set of named input/select/radio/checked/hidden fields in a form change. In particular, I'd like to capture when any changes are made to fields matching jQuery's selector $("form :input"), and where that input is has a name attribute. However, the form isn't static i.e. some of the fields are dynamically added later. My initial thought is to keep track of when new named elements matching :input are added, and then add an event handler, like this: function on_change() { alert("The form element with name " + $(this).attr("name") + " has changed"); } function reg_new_e_handler(input_element) { input_element.change(on_change); } However, I'm quite hopeful I can avoid this with some jQuery magic. In particular, is there a way to register an event handler in jQuery that would handle input elements that match the following: $("form :input").filter( function () { $(this).attr("name") } ).change(on_change); However, have this event set update whenever new input elements are added. I've thought that it may be possible to capture keyup event on the form node with $("form").keyup(on_change), but I'm not so sure how one could capture change events. I'd also like this to capture keyup events. Thank you for reading. Brian

    Read the article

  • JQuery UI Tabs - replace tab and contents

    - by Tauren
    What is the best way to replace the currently selected tab and its contents? The content is dynamically generated with jquery, not loaded via a URL. I need to do this from outside of any tab code or tab event handler (show, add, etc.). There is a link elsewhere on the page that should do the following when clicked: Change the tab's title Change the tab's className Clear out all elements of the tabcontent div Change the tabcontent div's className Generate new content inside the tabcontent div Note that the only reference this link's click() handler has is to the JQuery tabs object ($Tabs). I can get the selected tab with $Tabs.tabs('option','selected'). But how can I get a reference to the selected tab's tab and panel? Inside of a jquery tab handler (show, add, etc.), I have access to ui.tab and ui.panel, but is there a way to get them from a tabs option? Would it be better to simply remove the currently selected tab and then add a new tab in the same index location? I'd have to put the code to generate the tab content into the add() handler then I suppose.

    Read the article

  • Jquery Template textbox not showing datepicker

    - by pirzada
    I am using Datepicker on one of the the textbox in Jquery template but its not popping up. Outside of the template working fine. Below is what I want to do. jQuery().ready(function () { //$("#HireDate").datepicker(); $("#HireDate").datepicker({dateFormat:'dd-mm-yy', showAnim:'fadeIn'}) }); <script id="UserDetailTemplate" type="text/x-jquery-tmpl"> <table style="width:100%;"> <tbody> <tr> <td style="width:25%;font-weight:bold;">HireDate:</td> <td><input type="text" id="HireDate" value="${ HireDate }" /></td> </tr> </table> </td> </tr> </tbody> </table> </script>

    Read the article

  • Combining the jquery Calendar picker with the jquery validation and getting them to play nice?

    - by MBonig
    I'm just starting to get into jquery/javascript programming so this may be a beginner question but I sure can't seem to find anything about it. I have a text field on a form. I've used the JQuery UI Calendar picker to make data entry better. I've also added jquery validation to ensure that if the user enters the date by hand that it's still valid. Here is the html: <input class="datepicker" id="Log_ServiceStartTime_date" name="Log_ServiceStartTime_date" type="text" value="3/16/2010"></input> and javascript: $('form').validate(); $('#Log_ServiceStartTime_date').rules('add','required'); $('#Log_ServiceStartTime_date').rules('add','date'); the problem I'm having is this: If a user puts in a bad date, or no date at all, the validation correctly kicks in and the error description displays. However, if the user clicks on the textbox to bring up the calendar picker and selects a date, the date fills into the field but the validation does not go away. If the user clicks into the textbox and then back out, the validation correctly goes away. How can I get the calendar picker to kick off the validation routine once a date is selected? thanks

    Read the article

  • When to update jQuery?

    - by epaulk
    When you recommend updating jQuery/jQuery UI? Or in other words: what are the best practices for updating jQuery/jQuery UI? I’m working on a long project that will take at least one more year. In that time span, I’m sure that jQuery/jQuery UI will be updated many times. Do you recommend update my jQuery/jQuery UI files every time an update is released? Or is better to stick with a particular version until the end of the project? I’m afraid of “breaking” code changes, and every time an update is released, I have to test everything. That takes too much time. But on the other hand, if I didn’t update, I’m afraid of bugs that later will bite me in the rear. The project is an ASP.MVC and I use jQuery a lot. Any thoughts?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >