jquery-ui

stop page load in codeigniter jquery + ajax bookmark function

自作多情 提交于 2020-03-04 23:07:13
问题 I'm working on a bookmarking function (codeigniter, jquery, ajax). Below is the HTML for the form and the jQuery code. Here's what's happening: form is submitting the data to the database the page is reloading I'm not getting the success alert If I use e.preventDefault() or return false, the page doesn't reload and I get the success alert, but the data that gets passed to the database is 0. HTML FORM <?php echo form_open('bookmarks/addBookmark'); ?> <?php echo form_hidden('bookn', $bname); ?>

jQuery UI Drag and Drop—Draggable elements won't move horizontally?

与世无争的帅哥 提交于 2020-03-04 06:22:36
问题 I'm learning jQuery UI Drag and Drop. I've got vanilla code. I'd like the draggables to be able to drag horizontally and vertically. For some reason the draggables won't move horizontally yet. JS: $('.draggable').draggable({ containment: '#containerForDraggables', }); HTML: <div id="containerForDraggables"> <p class="draggable">Draggable #1</p> <p class="draggable">Draggable #2</p> <p class="draggable">Draggable #3</p> </div> Here's a jsfiddle: https://jsfiddle.net/VikR0001/dv48y1rb/15/ What

jQuery UI Drag and Drop—Draggable elements won't move horizontally?

試著忘記壹切 提交于 2020-03-04 06:22:09
问题 I'm learning jQuery UI Drag and Drop. I've got vanilla code. I'd like the draggables to be able to drag horizontally and vertically. For some reason the draggables won't move horizontally yet. JS: $('.draggable').draggable({ containment: '#containerForDraggables', }); HTML: <div id="containerForDraggables"> <p class="draggable">Draggable #1</p> <p class="draggable">Draggable #2</p> <p class="draggable">Draggable #3</p> </div> Here's a jsfiddle: https://jsfiddle.net/VikR0001/dv48y1rb/15/ What

How to highlight dates with jQuery's datepicker

我的梦境 提交于 2020-03-03 07:39:07
问题 I'm using Jquery UI datepicker to allow a user to fill a date input by selecting a date out of a displayed a calendar. So far, everything works as expected : http://jsfiddle.net/Aut9b/374/ Then, I wanted to highlight certain dates, to help the user choose, so I looked into the beforeShowDay option which makes that possible. beforeShowDayType: Function( Date date ) Default: null A function that takes a date as a parameter and must return an array with: [0]: true/false indicating whether or not

How to customize the color of the jquery slider range?

蹲街弑〆低调 提交于 2020-02-24 03:56:13
问题 When using the jquery slider, I would like to change the default color of the selected range from grey to blue. $(document).ready(function () { var slider = $('.slider').slider({ range: "min", min: 0, max: 100, change: function (e, ui) { // $("#img1").fadeOut(); // alert("done"); }, slide: function (e, ui) { var point = ui.value; $("#selected_value").html(point); var width = 100 - point; $("#range").css({ "width": point + "%" }); } }); my html: <div> Min: <span id="selected_value">0</span><br

How to customize the color of the jquery slider range?

帅比萌擦擦* 提交于 2020-02-24 03:56:08
问题 When using the jquery slider, I would like to change the default color of the selected range from grey to blue. $(document).ready(function () { var slider = $('.slider').slider({ range: "min", min: 0, max: 100, change: function (e, ui) { // $("#img1").fadeOut(); // alert("done"); }, slide: function (e, ui) { var point = ui.value; $("#selected_value").html(point); var width = 100 - point; $("#range").css({ "width": point + "%" }); } }); my html: <div> Min: <span id="selected_value">0</span><br

Error: cannot call methods on spinner prior to initialization; attempted to call method 'disableWithoutRemovingValue'

北城余情 提交于 2020-02-24 03:41:27
问题 I tried to use the ui.spinner.js plugin, and in document ready i initialize some textbox to be a disabled spinner like this: $('#id').spinner("disableWithoutRemovingValue"); In this case is have this error : Error: cannot call methods on spinner prior to initialization; attempted to call method 'disableWithoutRemovingValue'. Also, i tried to change disableWithoutRemovingValue by using option but still i have the same error. So, is there any one help me to fix this error? 回答1: I've been stuck

Using jQuery or CSS to select the jQueryUI autocomplete list

徘徊边缘 提交于 2020-02-23 06:51:28
问题 jQueryUI autocomplete creates a ul list similar to the following. How do I select the ul list using jQuery or CSS? I could do ul.ui-autocomplete , however, I don't want to select every list of this class on my page but just one specific one. The IDs (i.e. ui-id-1 ) are generated by the plugin, so I can't use these. I thought maybe the open event would give me access, however, doesn't appear to be the case. addClass() adds the class to the input and not the ul <ul class="ui-autocomplete ui

Drag and drop with 2 drop target

|▌冷眼眸甩不掉的悲伤 提交于 2020-02-21 03:09:48
问题 I am looking for an example of drag and drop where the drag item has two distinct areas that have to match up with two droppable areas. Example: I would like the blue drag item to revert unless it is dropped in a position where each of its red children land on a green area. Ideally I would like to use jquery ui (as I have experience with it), but any javascript library would be fine, thanks in advance. 回答1: You can accomplish this by using a combination of draggable / droppable options. Given

jquery select from within element

风流意气都作罢 提交于 2020-02-16 05:27:29
问题 How do I do this (but in a way that works): $("MyElem").get("[id$='Date']").datepicker(); Essentially I'm trying to select all elements that end with the word "Date" in the id within the context of a given parent element. So this should be interpreted as: Get "MyElem". From "MyElem" search all children recursively and find id's that end with "Date". For each item in the results of step 2 call datepicker on that element 回答1: Why not using find method: $('#myelem').find('[id&=Date]').datepicker