jquery

JQuery - Select All CheckBoxes within current table only

末鹿安然 提交于 2021-02-18 12:13:10
问题 I have two nested repeaters in C#. The outer has some grouping information and the inner has a table with X number of checkboxes. So I will have Y number of tables. At the top of each table there will be a check box (as well as a checkbox on each row). What I want to do is be able to select all check boxes in a single table from the checkbox at the top of each table. I can select ALL checkboxes in one go as follows: $(document).ready(function() { $("#checkboxflipflop").click(function() { var

jQuery DataTables - get page of a given row

我与影子孤独终老i 提交于 2021-02-18 11:42:09
问题 I have a dataTable with hundreds of items with a fixed 50 iDisplayLength option. I need to be able to find what page a specific row is within the loaded nodes. All I've managed is to get the position, unfortunately that internal row position does not correspond to the row index with the current sorting and filtering. As an example here on jsFiddle. I can retrieve the position or row #tr4 (position 3) but the iDisplayStart I need is 2. <table id="example"> <thead> <tr> <th>ID</th> <th

jQuery Validation on input-append ( Twitter Bootstrap )

无人久伴 提交于 2021-02-18 11:32:10
问题 I am using twitter bootstrap for a site, and we use jquery.validate. I have a input element with button appended to input element. This is a required field within our js validation. The code is: <div class="controls"> <div class="input-append"> <input tabindex="1" name="url" class="input-large" id="url" type="text" placeholder="http://somewebsite.com" autocapitalize="off"> <button class="btn" type="button" name="attach" id="attach" />Fetch</button> </div> </div> Validation error class uses

Enable/Disable events of DOM elements with JS / jQuery

随声附和 提交于 2021-02-18 11:19:29
问题 I stuck here with a little problem I have put pretty much time in which is pretty bad compared to its functionality. I have tags in my DOM, and I have been binding several events to them with jQuery.. var a = $('<a>').click(data, function() { ... }) Sometimes I would like to disable some of these elements, which means I add a CSS-Class 'disabled' to it and I'd like to remove all events, so no events are triggered at all anymore. I have created a class here called "Button" to solve that var

problems executing a jquery ajax call within a function

我们两清 提交于 2021-02-18 11:12:16
问题 I would like to put an ajax call within a function since I use it repeatedly in multiple locations. I want a manipulated version of the response returned. Here's what I'm trying to do (greatly simplified). a = getAjax(); $('body').append('<div>'+a+'</div>'); function getAjax() { $.ajax({ type: "GET", url: 'someURL', success: function(response) { return response; }); } What's happening, however, is that the append function is running before "a" has been defined in the getAjax function. Any

problems executing a jquery ajax call within a function

孤街醉人 提交于 2021-02-18 11:11:41
问题 I would like to put an ajax call within a function since I use it repeatedly in multiple locations. I want a manipulated version of the response returned. Here's what I'm trying to do (greatly simplified). a = getAjax(); $('body').append('<div>'+a+'</div>'); function getAjax() { $.ajax({ type: "GET", url: 'someURL', success: function(response) { return response; }); } What's happening, however, is that the append function is running before "a" has been defined in the getAjax function. Any

problems executing a jquery ajax call within a function

删除回忆录丶 提交于 2021-02-18 11:11:20
问题 I would like to put an ajax call within a function since I use it repeatedly in multiple locations. I want a manipulated version of the response returned. Here's what I'm trying to do (greatly simplified). a = getAjax(); $('body').append('<div>'+a+'</div>'); function getAjax() { $.ajax({ type: "GET", url: 'someURL', success: function(response) { return response; }); } What's happening, however, is that the append function is running before "a" has been defined in the getAjax function. Any

How would I design a client-side Queue system?

回眸只為那壹抹淺笑 提交于 2021-02-18 10:58:07
问题 OVERVIEW I'm working on a project and I've come across a bit of a problem in that things aren't happening in the order I want them to happen. So I have been thinking about designing some kind of Queue that I can use to organize function calls and other miscellaneous JavaScript/jQuery instructions used during start-up, i.e., while the page is loading. What I'm looking for doesn't necessarily need to be a Queue data structure but some system that will ensure that things execute in the order I

Combining change, mouseup, mousedown, mouseout, keyup and keydown into the one function

…衆ロ難τιáo~ 提交于 2021-02-18 10:38:05
问题 What I have: I have a text box that assumes the value of whatever option is selected in a corresponding select box. I'm repeating the exact same function for the on change, mouseup, mousedown, mouseout, keyup and keydown events What I need: Can the aforesaid functions be combined into one to produce more efficient code? It just seems terribly repetitious. My code: JSFiddle: http://jsfiddle.net/clarusdignus/843YW/1/ HTML: <label>Industry:</label> <select name="industry"> <option selected=

owl carousel scroll to clicked item

浪子不回头ぞ 提交于 2021-02-18 10:30:06
问题 I have a simple owl-carousel, HTML: <div class="owl-carousel"> <div class="item"><h4>1</h4></div> <div class="item"><h4>2</h4></div> <div class="item"><h4>3</h4></div> <div class="item"><h4>4</h4></div> <div class="item"><h4>5</h4></div> <div class="item"><h4>6</h4></div> <div class="item"><h4>7</h4></div> <div class="item"><h4>8</h4></div> <div class="item"><h4>9</h4></div> <div class="item"><h4>10</h4></div> <div class="item"><h4>11</h4></div> <div class="item"><h4>12</h4></div> </div>