jquery-ui

jQuery ui selectmenu vertical position offset (relatively to buttons in this line)

£可爱£侵袭症+ 提交于 2020-01-16 02:21:23
问题 In my form I place control elements in a line: button, select box, checkbox. It looks logically right. But since I've started using jQuery UI I see strange vertical of select box. Here's the example from jquery-ui site, a little bit shortened: https://jsfiddle.net/Tertium/z829pay7 $(function() { $( "#speed" ).selectmenu( { width: 200}); $( "#files" ).selectmenu({ width: 200}); $( "#but1" ).button(); $( "#but2" ).button(); }); Tested on jquery 1.11.2 and 1.10.2, jquery-ui: 1.11.3, all settings

How to stop function on blur()

不问归期 提交于 2020-01-16 01:20:27
问题 myfucntion = send request after 5 sec document.ready(myfucntion) $(window).focus(myfucntion) $(window).blur(stop(myfucntion)) is this possible to stop a function on blur called previously in document.ready 回答1: Have a global timer: var intervalId; And it would be better to have two functions: startfunction() { intervalId = setTimeout(function () { // send request after 5 seconds }, 5000); } stopfunction() { clearTimeout(intervalId); } And use them like this: $(document).ready(startfunction);

How to prevent jquery datepicker from popping up on initial page load but still scroll to datepicker textbox

房东的猫 提交于 2020-01-16 01:20:16
问题 I have something similar to the following javascript: $(function () { $("#txtDate").focus(); $("#txtDate").datepicker({ ... autoOpen: false, ... }); }); I want to focus in on the textbox on page load without having the datepicker pop up. Currently the page loads with the datepicker already open. I need to be able to have the page scroll to that textbox on page load and it would be nice for the txtDate textbox to have focus so that users can tab to the next input in the form easily. Any help

How to put default value in CJuidatepicker in Yii?

扶醉桌前 提交于 2020-01-16 01:16:09
问题 I have the code below to display a calendar input in Yii form. <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array( 'name' => 'publish_date', 'attribute' => 'publish_date', 'model'=>$model, 'options'=> array( 'dateFormat' =>'yy-mm-dd', 'defaultDate' => '2014-3-4', 'altFormat' =>'yy-mm-dd', 'changeMonth' => true, 'changeYear' => true, 'appendText' => 'yyyy-mm-dd', ), )); ?> The default value work on the calendar but I want to show it by default in the calendar input too when the form

JSON return empty response on FireFox & Safari (Windows Vista)

限于喜欢 提交于 2020-01-16 00:38:08
问题 SOLVED: The problem lies within Firefox 6.0.2 security. I have changed my URL request from: http://mysite.com/ajax/request to /ajax/request and Its working. If you need to use cross domains, you need to use jsonp as your dataType. Many thanks to evildead My JSON request to my server returns an empty response. This only happens in Firefox 6.0.2 and Safari in a Windows Vista machine. The output is generated by a php script and has json/application headers. This returns empty response: $('

jQModal or jQuery UI Dialog?

99封情书 提交于 2020-01-15 23:05:15
问题 Seeking some advice as to whether use jQModal window or instead use the jQuery UI Library for a modal window ? The jQModal lib is only 2.4KB while the jQuery UI lib is like 32KB - generally all I am looking for is a modal window ? 回答1: I would use jQuery UI modal. Official and well supported. jQuery UI and themes are available on Google's CDN. You may want to use other parts of jQuery UI down the track. But then again, if the filesize difference bothers you, just use the jQModal plugin. Bear

jQuery UI Dialog Closes When the Title is Clicked … Sometimes

老子叫甜甜 提交于 2020-01-15 12:47:26
问题 I have a jQuery UI Dialog with some strange behavior: whenever you click or double-click on the header/title of the dialog, there is a chance that it will close the dialog, without removing the modal overlay (double-clicks seem to trigger it more often than clicks, but both are pretty frequent and neither one triggers a close 100% of the time). The fact that the modal is left behind makes me think that an error is happening, but there's no errors in the console. I'd be tempted to blame my

JS restrict mouse movement with axis when shift pressed (for draggable element)

匆匆过客 提交于 2020-01-15 12:45:29
问题 When shift button pressed I want user to be able to only move mouse strictly up/down or left/right. My current rough idea is to intercept all movements when shift is pressed and use events simulation to pass needed event (which will contain only needed axis movement) further. I use jQuery Draggable so other idea is to determine when shift is pressed and restrict draggable itself but this might require investigating draggable code and might be time consuming. Any ideas how to do this in more

send Form data using jQuery which has appended div inside it

半腔热情 提交于 2020-01-15 12:23:32
问题 I'm not able to send the complete form data using form.I'm able to send the stored data containing even name, event status, trigger event and relay state. The data of the appended div is being sent as the value which is stored in its previous values. $(document).ready(function () { $("#condition").click(function (e) { e.preventDefault(); $('#shw').append($('.hiddenRule').clone().removeClass("hiddenRule")); }); }); $('#shw').on('click', '#delete', function (e) { e.preventDefault(); $(this)

using the result from jQuery into C#

拜拜、爱过 提交于 2020-01-15 11:43:08
问题 I have this function in jquery which has the result array and how can I get this result array to C# code. Can anyone help me regarding this. function generateData() { var result = $('#accordion').sortable('toArray'); } 回答1: You could do this asynchronously through a web method call from script, such that you define a web method appropriately, then call and handle the data and potential return value, as desired. For example: Defining a web method: [WebMethod] [ScriptMethod(ResponseFormat =