jquery

mixitup counting visible items on initial start after page loading

风格不统一 提交于 2021-01-29 03:18:34
问题 I am playing with mixitup to sort items. I can count items visible after I press a sort or filter buttons: $('#collection').on('mixEnd', function(e, state){ var countvisible = $("#container> tr[style='']").length; console.log('Sorted! ' + countvisible ); $('#current_count').text(countvisible); }); What I need: get a count of visible items on page load but the `on('mixEnd') does NOT ignite during the initialization of the mixitup on page load. How to do it? I can just use on PageLoad sit some

ChartJS: chart not show all data

匆匆过客 提交于 2021-01-29 03:18:14
问题 For some reason, this chart not show the last two data from the array. var data = { labels: ["Brasil", "Argentina", "Chile", "Paraguai", "Peru", "Bolívia", "México"], datasets: [{ data: [ 9.19, 7.77, 6.80, 6.23, 6.00, 4.00, 4.00 ], backgroundColor: backgroundColor }], }; http://codepen.io/marcelo2605/pen/PWWqJm?editors=0010 Anyone known why is this happens? 回答1: you need to set Y-Axis to start with 0, by default it start with the minimum value present in the data set which is 4 in your case.

AJAX not sending image file to server

旧时模样 提交于 2021-01-29 03:13:29
问题 So this ajax code: var btn = $("input[name=submitname]"); var url = btn.parents("form").attr("action"); var fileName = btn.parents("form").find("input[type=file]").attr("name"); var fileVal = btn.parents("form").find("input[type=file]").val(); var dataString = btn.parents("form").serialize() + "&" + btn.attr("name") + "=" + btn.val() + "&" + fileName + "=" + fileVal; $.ajax({ url: url, type: "POST", data: dataString, processData: false, contentType: false, cache: false, success: function(data

Boostrap dynamic div position

妖精的绣舞 提交于 2021-01-29 03:12:31
问题 i need yout help. i've two parent div, <div class="container-fluid" > <div class="row-fluid" id="id"> in these div I put other div created by an ajax call. I created a div which will then be populated with data. the div is: <div class="col-sm-3 col-md-5 space"> <h2 style="color:#900000">###</h2> <p class="lead">### <p> <p style="text-align: right"><i class="fa fa-clock-o"></i>12/5/24</p> <div class="thumbnail"> <img src=""> </div> <div class="caption"> <p>Differetn lenght of data -<<< PROBLEM

ondragstart not triggering in firefox

↘锁芯ラ 提交于 2021-01-29 03:09:58
问题 Hello I'm trying to use the html drag and drop feature with jquery. I generate my draggable (a button) like this $("#tb > tbody > tr").append(($("<td>")).append($("<input/>", {type:"button", id:"bt", draggable:"true", value:"test", class:"bt-test"}))).append($("</td>")); So far, and after reading a bit on the subject, I'm trying to deal with the different events like this : $(document).on("dragstart", ".bt-test", function(evt) { evt.originalEvent.dataTransfer.setData("text", $(this).val());

Show html after completing work with ajax and jquery

浪子不回头ぞ 提交于 2021-01-29 03:07:16
问题 codes below is that I made to explain. So it is not complete one. I wrote just enough to explain my question. html load -> call ajax -> json(response) -> append table row with the json by jquery whenever I use ajax and update page with response data and append some elements in page with jquery, it shows process of appending one by one in jquery very quickly in screen. 1.Can I have way to show all table at once when it is done appending all elements in for loop with jquery? 2.In my example

Show html after completing work with ajax and jquery

三世轮回 提交于 2021-01-29 03:05:21
问题 codes below is that I made to explain. So it is not complete one. I wrote just enough to explain my question. html load -> call ajax -> json(response) -> append table row with the json by jquery whenever I use ajax and update page with response data and append some elements in page with jquery, it shows process of appending one by one in jquery very quickly in screen. 1.Can I have way to show all table at once when it is done appending all elements in for loop with jquery? 2.In my example

How can I use jQuery to convert <div> into HTML table?

夙愿已清 提交于 2021-01-29 03:01:10
问题 <div> Hii,this is just an example </div> change to <td>Hii, only tag will be change </td> 回答1: in case someone needs to convert on the-fly: var div2table = $('.outer-div ').map(function () { var issue = $(this); var trline = issue.find('.inner-div').map(function () { return '<td>' + $(this).text(); }).get().join('</td>'); return '<tr>' + trline; }).get().join('</tr>'); div2table = '<table>' + div2table + '</table>'; where divs are <div class='outer-div'><div class='inner-div'>this will be 1st

How to automatically move element in available vertical space?

情到浓时终转凉″ 提交于 2021-01-29 02:57:49
问题 I have elements on a web page. For tablet breakpoints, the content will go 50% width and break up into two columns. However, sometimes depending on the content, there are times when there are blank spaces that show up on the page. Is there a way to place the elements into optimal positioning so that it takes up the available vertical space? I do not have control of the markup. Please note: I don't have control of the content. I just used random heights in this example, but they could be

What does the '&&' expression mean in this snippet of JavaScript? [closed]

别来无恙 提交于 2021-01-29 02:52:04
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Hi, I recently got a piece of JavaScript code snippet from here. Could someone please explain how this statement works: (jq=jq.slice(1)).length && hidenext(jq); in the function below? (function hidenext(jq){ jq