jquery-plugins

jQuery Cycle plugin - pause/resume weird behavior

无人久伴 提交于 2020-01-13 18:03:51
问题 I have a slideshow running with the awesome cycle plugin, and when you click a button in the show, I show a hidden layer on the page and send a 'pause' command to cycle. I'm having two problems: When the pause command is received, cycle immediately flips back to the 1st slide in the sequence (why??), and doesn't hit my before/after callbacks. After closing the layer, I send a 'resume' command to cycle. The slideshow resumes (from the 1st slide, where the pause left it), but now cycle doesn't

Disable typing 0 (zero) at first character position

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-13 16:54:31
问题 I'm using a Jquery numeric plugin that only allows numeric values to be typed in an input $("#tbQuan").numeric(); In addition to what this plugin is doing I need to disable typyng '0' (zero) at the first character position. Any help would be appreciated. 回答1: Try this. $('input').keypress(function(e){ if (this.value.length == 0 && e.which == 48 ){ return false; } }); Demo 回答2: Something like this should get you started: $("#tbQuan").numeric().keyup(function (e) { var val = $(this).val();

Disable typing 0 (zero) at first character position

瘦欲@ 提交于 2020-01-13 16:54:08
问题 I'm using a Jquery numeric plugin that only allows numeric values to be typed in an input $("#tbQuan").numeric(); In addition to what this plugin is doing I need to disable typyng '0' (zero) at the first character position. Any help would be appreciated. 回答1: Try this. $('input').keypress(function(e){ if (this.value.length == 0 && e.which == 48 ){ return false; } }); Demo 回答2: Something like this should get you started: $("#tbQuan").numeric().keyup(function (e) { var val = $(this).val();

jQuery output to console sum of 2 variables

我的未来我决定 提交于 2020-01-13 14:47:21
问题 The following code tracks how many clicks or tabs are completed by a user traversing a form and adds a behavioural score: $(function() { $.fn.clickCount = function() { var clickCount = 0; var clickBehaviour = 0; return { increment: function() { clickCount++; }, behaviour: function() { clickBehaviour -= 5; }, print: function() { console.log('Click count:' + clickCount); console.log('Click behaviour:' + clickBehaviour); } }; }; $.fn.tabCount = function() { var tabCount = 0; var tabBehaviour = 0

How do I have jQuery's autocomplete plugin display its dropdown list upon page load?

限于喜欢 提交于 2020-01-13 08:35:41
问题 http://community.sciencecareers.org/mt-static/plugins/CommunityPlus/js/autocomplete/ http://community.sciencecareers.org/mt-static/plugins/CommunityPlus/js/autocomplete/demo/ Trying to programmatically trigger the display of the autocompletion list results. This, instead of waiting for user input. Is this doable? (I've tried getting the element's focus, calling a Javascript down-arrow key event. No dice) 回答1: If, and only if, you are using a version of jQuery 1.3 or greater, you can create a

Can't get the destroy() method of a jQuery UI plugin to work (+conflicting jQuery plugins)

喜欢而已 提交于 2020-01-13 02:46:11
问题 Background/General Problem I'm trying to fix a friend's website in which two jQuery plugins he added aren't playing nice. Basically, one (foundation - a grid layout with tabs) isn't playing nice with the second (RoyalSlider - an image slider) because the latter needs to "see" the slider material while the former hides inactive tabs. The page in question has three tabs, each with one of these RoyalSliders on them. The original code initialized the slider for each of the three tabs right away

Jquery dialog to open another page

情到浓时终转凉″ 提交于 2020-01-12 08:29:10
问题 There is a page as transaction.html How to open this page in a popup in another page say show_transactions.html in a jquery dialog $dialog.html() //open transaction.html in this dialog .dialog({ autoOpen: true, position: 'center' , title: 'EDIT', draggable: false, width : 300, height : 40, resizable : false, modal : true, }); alert('here'); $dialog.dialog('open'); This code is present in show_transactions.html Thanks.. 回答1: You can use jQuery's .load() method to load a page into a dialog,

Reading RSS feed with jQuery?

烈酒焚心 提交于 2020-01-11 19:40:36
问题 Using the jQuery rss pluging jFeed, and using their example code on their website, I have created the following code which does not seem to work: jQuery.getFeed({ url: 'http://www.hotukdeals.com/rss/hot', success: function(feed) { alert(feed.title); } }); I get a message saying: XMLHttpRequest cannot load http://www.hotukdeals.com/rss/hot. Origin http://intranet is not allowed by Access-Control-Allow-Origin. Anyone know why I am getting this access control message? This rss feed works fine in

How to jsonify “Add” post/parameters for jqGrid

ぐ巨炮叔叔 提交于 2020-01-11 12:52:31
问题 This one's killing me. I've read through a lot of Oleg's comments, and through the documentation, but I think I'm overlooking something really simple. I have a jqGrid populated by calling a webmethod that returns JSON. We're good there. I'm using the Navigator for my "Add" button, and using onSelectRow w/ jqGrid.editRow() for my editing. I get the dialog box when clicking the "Add" button, and can fill everything in. However, I get a error Status: 'Internal Server Error'. Error code: 500

jScrollPane scrollbar disappears when applying scrollTo

☆樱花仙子☆ 提交于 2020-01-11 12:33:00
问题 I have a problem with the jQuery extension jScrollPane combined with the scrollTo plugin. The scrollbar disappears if I apply the scrollTo command to the scrollable container and the scroll is at the top position . (If the scroll is not at the top position, everything is working fine.) To get the scrollbar back, I try to reinitialize it. What happens then is that the scroll goes back to the top, canceling the scrollTo command. My code: $('#myScrollableDiv div.jspContainer').scrollTo(delta); c