jquery-plugins

How to use JQuery .on() to catch the scroll event

走远了吗. 提交于 2019-12-19 17:27:03
问题 I'm attempting to use the .on() from jQuery to catch a scroll event that is inside a tag. so this was my solution: the div id='popup' the .fixedHeader class is something I'm trying have fixed at the top of the div frame. getScrollTop() is a javascript function to return the top value (works) $(document).on("scroll#popup", '#popup', function(){ alert('scrolling'); $(".fixedHeader").css("position", "relative"); $(".fixedHeader").css("top", getScrollTop()); }); 回答1: The event is simply scroll ,

Jquery validation - checking email and username availability from server-side Django

♀尐吖头ヾ 提交于 2019-12-19 12:04:21
问题 I'm trying to validate the registration form for email and username availability from server-side programmed with Django. I checked this one jQuery Validation Plugin remote check for password with Django but I'm getting 403 forbidden - CSRF verification failed. I tried including csrf token inside the jquery script. But still not working. I've shown the code below for checking email availability. views.py: def email_check(request): response_str="false" if request.is_ajax(): e = request.POST

jQuery autocomplete @mention

女生的网名这么多〃 提交于 2019-12-19 11:49:28
问题 I have this autocomplete plugin from Andrew Whitaker - DEMO Lets say I have a string in a textarea "@peterwateber welcome" I want it to output in a hidden tag as "@[peterwateber] welcome" how should I do it? I'm not that good at Javascript... I've tried looking at this code here from Hawkee 回答1: I wrote the original code mentioned here and have fixed the menu problem Peter was having: http://www.hawkee.com/snippet/9391/ 回答2: Hiya Working demo here: http://jsfiddle.net/67dxH/ Already had good

jQuery Tokeninput with “Combobox” functionality?

天涯浪子 提交于 2019-12-19 11:05:39
问题 I'm using Loopj Tokeninput plugin and I would like to know if anyone has implemented the jQuery "combobox" functionality in it? or something similar? The scope is to allow for displaying all the data from a local source by clicking an "arrow down" or just by clicking in the input field just like a dropdown menu (but allowing to narrow it down when typing something...). If so, could anyone share how to implement it? 回答1: Hey there is no method predefined to do that in tokeninput plugin..

FancyBox Iframe not closing second time

不想你离开。 提交于 2019-12-19 10:43:14
问题 I know this question was asked before however I cannot get my code to work. I have my fancybox initiated: $(document).ready(function() { $('.fancybox').on('click', function(event) { event.preventDefault(); $.fancybox({ 'type' : 'iframe', // hide the related video suggestions and autoplay the video 'href' : this.href = this.href.replace(new RegExp("([0-9])","i"),'moogaloop.swf?clip_id=$1') + '&autoplay=1', 'overlayShow' : true, 'centerOnScroll' : true, 'speedIn' : 100, 'speedOut' : 50, 'width'

jQuery Validation PlugIn : Callback for field success validation?

你说的曾经没有我的故事 提交于 2019-12-19 10:27:59
问题 Im am using errorPlacement to add a class to a label to show a graphic element in addition to the error text ( they are both different elements). Is there a way to use a callback that will fire when the validation of a field is successful? I am already using validClass, that will change the error message, but I need a call back so I can change the graphic element to a "success" one. For Example [graphic] [input field] [error text] I was able to change the [graphic] and the [error text] when

How to display unique success messages on jquery form validation

扶醉桌前 提交于 2019-12-19 10:26:25
问题 hope you can help me on this one, I'm currently using this: jQuery plugin:validation (Homepage) I've been reading related questions here, but this one is the closest get. httx://stackoverflow.com/questions/1863448/jquery-validation-on-success from the plugin's documentation httx://docs.jquery.com/Plugins/Validation/validate#toption success String, Callback If specified, the error label is displayed to show a valid element. If a String is given, its added as a class to the label. If a Function

Best way to load and unload JS file via JQuery

倖福魔咒の 提交于 2019-12-19 09:41:34
问题 I've been frustated trying to find the best way to load and unload some JS file via jQuery, this was last what I can do: $("#button").live("click", function(){ var pl = $(this).attr('rel'); $.getScript('' + siteAddress + 'min/?js=fjs'+ pl +'', function() { $('#container').load(""+ siteAddress +"load/"+ pl +"/"); }); }); What I want to do is to load some page via jQuery, and at same time it will include appropriate external JS file for current page that been loaded, it work fine for the first

Why this and not $(this) in jQuery plugins

会有一股神秘感。 提交于 2019-12-19 08:29:41
问题 The docs tell us: Let's say we want to create a plugin that makes text within a set of retrieved elements green. All we have to do is add a function called greenify to $.fn and it will be available just like any other jQuery object method. $.fn.greenify = function() { this.css( "color", "green" ); }; $( "a" ).greenify(); // Makes all the links green. Notice that to use .css(), another method, we use this, not $( this ). This is because our greenify function is a part of the same object as

Need Help with Jquery TableSorter Pager plugin

断了今生、忘了曾经 提交于 2019-12-19 08:18:13
问题 I am using the tablesorter plugin: http://tablesorter.com/docs/ with jquery 1.4.2 Now my problem is this. The user can dynamically add rows to the table. But this seems to mess up the paging. Like first it gets added to the first "page" of rows but if you would go to the second page and you go back to the first page. You newly record is gone. I don't know where it goes but it is just gone. I tried to do this $('#pagerid').unbind('click'); $('#tbl tbody ').append(response.HtmlRow); $('#tbl')