jquery-ui

jquery ui ddraggable : limit dragable area by pixels

大城市里の小女人 提交于 2021-02-08 06:44:24
问题 I have an Image and I want to allow users to drag the image only in Y axis and I have to limit the dragging by pixels, which means users can drag only 200 pixels in Y axis (either upside and downside) <script> $(function() { $( "#img" ).draggable({ axis: "y" }); }); </script> I could limit the dragging in Y axis only but I didn't see an option to limit the dragging in pixels. please help 回答1: There is also the option 'containment' where you can specify a bounding box with coordinates (among

Updating sort order during sort change event - jQuery UI

こ雲淡風輕ζ 提交于 2021-02-07 18:53:33
问题 I want the value of the list element to be the index of the sorted position during sort event. This value should update automatically during sort change event. <script type="text/javascript"> $(function() { $('#sortable').sortable({ start : function(event, ui) { var start_pos = ui.item.index(); ui.item.data('start_pos', start_pos); }, change : function(event, ui) { var start_pos = ui.item.data('start_pos'); var index = ui.placeholder.index(); if (start_pos < index) { $('#sortable li:nth-child

Force Jquery-UI Datepicker to open under the Input?

点点圈 提交于 2021-02-07 09:25:20
问题 I´m using a Datepicker with Jquery-Ui and I need it to always display under the input. I checked the API documentation, googled it and searched for it on Stackoverflow, but I could not find a solution: I tried these codes: popup: { position: "bottom left", origin: "top left" }, __ orientation: "bottom", Anyone has an idea how to do this? 回答1: Can do this with an inline datepicker. Working Example: https://jsfiddle.net/0e3njzoe/2/ HTML <div class="tall"> Tall Div </div> <label for="myDate"

Jquery progress bar server side

僤鯓⒐⒋嵵緔 提交于 2021-02-07 09:14:15
问题 I have a long running process(not definite time) in server-side(which runs number of queries in db) which takes more than 30s. I want to display the progress in % to the user. I'm using jquery ,struts in my application. Is there a way to do it? 回答1: This is how we did it. When the process is triggered create a GUID from the client and pass it to the server. In the server side, run the process and during the run, keep storing the progress in session/cache using the GUID as key. In the client

Jquery Ui Datepicker change icons

笑着哭i 提交于 2021-02-07 08:33:44
问题 Is there a way I can change the "Prev" and "Next" month icon of the Jquery Ui Datepicker, I know the icon is defined by the class. It look like the theme roller don't give this option. 回答1: You can override the arrow styles and set them to your custom image; remember to set !important to your custom rules in order to override the jQueryUI defaults. Like (images found on google): .ui-datepicker-prev span { background-image: url(http://legacy.australianetwork.com/img/icon_arrow_left_black.png)

JQuery Autocomplete : can't apply style on the focused item

一个人想着一个人 提交于 2021-02-07 07:26:20
问题 I have a simple input like that <input id="name-srch" type="text" data-type="string"> And my js (simplified) $('#name-srch').autocomplete({ source: function (request, response) { $.ajax({ url: ..., data: ..., success: function (data) { // note that 'data' is the list of elements to display response(data) } }); }, select: function (event, ui) { // do some stuff return false }, focus: function (event, ui) { console.log(ui.item.Name) // just to see if the focus event is triggered, and it is

jQuery UI Sort - two list and prevent sortable inside origin list

不打扰是莪最后的温柔 提交于 2021-02-07 06:57:13
问题 I have a simple example of jquery ui. Basicly i have to list of items, each one is sortable. And what i want to accomplish is the following: cancel sorting of the same list. with an example, if I click over an element on position one on list one, then drag it to position 6, and dropped. I want to prevent that, but if i drop the element in list two, that is ok. i don't know how to specify, in order to fit my requeriments. ConnectWith seems not to be enough: $("#sortable").sortable({

jQuery UI non ajax tab loading whole website into itself?

痴心易碎 提交于 2021-02-06 09:48:31
问题 Having a large problem with jQuery Tabs. Im trying to load the tabs on my sites product page... When the page loads i see that tabs content for a second (standard html tabs not ajax) then suddenly my whole website loads inside the tab. i am using the standard code from the jquery ui tabs demo page. <div id="productTabs"> <ul> <li><a href="#tabDescription">Description</a></li> <li><a href="#tabSpecs">Specifications</a></li> <li><a href="#tabReviews">Reviews</a></li> <li><a href="#tabDownloads"

Get the order of list item in jquery sortable

跟風遠走 提交于 2021-02-06 03:02:42
问题 I have done this http://jsbin.com/UBezOVA/1/edit. When I click the submit button, i want to get the current order of the list item. But, it seems that $("#sortable2").sortable("toArray") does not show the current order of list (for example sortable2). How to get the current order of a list. 回答1: Part of your issue is a typographical error, omitting the # from the id in your jQuery selector. Otherwise, your usage of .sortable("toArray") is correct. (Note, I used console.log() there instead of

Get the order of list item in jquery sortable

给你一囗甜甜゛ 提交于 2021-02-06 03:01:08
问题 I have done this http://jsbin.com/UBezOVA/1/edit. When I click the submit button, i want to get the current order of the list item. But, it seems that $("#sortable2").sortable("toArray") does not show the current order of list (for example sortable2). How to get the current order of a list. 回答1: Part of your issue is a typographical error, omitting the # from the id in your jQuery selector. Otherwise, your usage of .sortable("toArray") is correct. (Note, I used console.log() there instead of