jquery

Sticky table headers with firefox / IE

廉价感情. 提交于 2021-02-10 14:31:56
问题 I am using a div with display:table and I am trying to create sticky headers. Chrome supports position:sticky with display:table-row but firefox and IE do not. Therefore, I created a code that changes the div position to "fixed" on scroll and the top to 0. This gets the same result. However, when changing the position to "fixed" the header row stops being a part of the table and therefore it's width is changed. (And is no longer synced with the other table rows) I tried to fix it with saving

Sticky table headers with firefox / IE

烈酒焚心 提交于 2021-02-10 14:30:13
问题 I am using a div with display:table and I am trying to create sticky headers. Chrome supports position:sticky with display:table-row but firefox and IE do not. Therefore, I created a code that changes the div position to "fixed" on scroll and the top to 0. This gets the same result. However, when changing the position to "fixed" the header row stops being a part of the table and therefore it's width is changed. (And is no longer synced with the other table rows) I tried to fix it with saving

Add required attribute based on selected <select> value

霸气de小男生 提交于 2021-02-10 14:25:41
问题 I have a form with a <select> with two options and an <input> . By default the <input> isn't required to submit the form. When the selected option from <select> has a value of pizza I want to add the required attribute to the <input> . I also want it removed if the user switches to the other <select> option. $(function() { var paymentType = $("#paymentType option:selected").val(); if (paymentType == 'pizza') { $("firstName").prop('required', true); } else { $("firstName").prop('required',

navigation drawer opens by pulling down other web blocks

浪尽此生 提交于 2021-02-10 14:24:53
问题 navigation drawer opens by pulling down other web blocks. when it closes blocks come up. additionally drawer menu has occupied more space of my web sites top space. unable to keep blocks near the navigation bar. A big empty space there. But drawer menu works fine. how to solve this issue? HTML <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My web</title> <link rel="stylesheet" href

Enfocing min width on Kendo Grid (jQuery) when grid has hidden columns

时间秒杀一切 提交于 2021-02-10 14:24:36
问题 I am trying to enforce a min-width rule for resizable columns in the Kendo Grid. I used the sample that they provided here. In their example all of the columns are being displayed. In my case there are some columns which are hidden. I have a sample here using Kendo's Dojo to illustrate my problem. Any column that comes after the hidden column no longer maintains the min-width rule. Best I can figure is that this is an issue with jQuery and it's interactions with elements that have been set to

Enfocing min width on Kendo Grid (jQuery) when grid has hidden columns

早过忘川 提交于 2021-02-10 14:23:22
问题 I am trying to enforce a min-width rule for resizable columns in the Kendo Grid. I used the sample that they provided here. In their example all of the columns are being displayed. In my case there are some columns which are hidden. I have a sample here using Kendo's Dojo to illustrate my problem. Any column that comes after the hidden column no longer maintains the min-width rule. Best I can figure is that this is an issue with jQuery and it's interactions with elements that have been set to

Auto trigger click on a button when selecting from dropdown list

≡放荡痞女 提交于 2021-02-10 14:21:44
问题 I'm working on a smarty template. I cannot edit the PHP code as it is encoded. I have an order form where clients view their total due, fill-in their personal information, and then complete payment. Items on my website are taxable for the United States and each state has different rate. My system does not allow dynamic tax rate calculation based on user's selection to the state, but it provides a (Tax Update) button where users manually click on it to update the tax rate. I'm trying to

jQuery current page highlight

旧街凉风 提交于 2021-02-10 14:21:12
问题 How can I use jQuery to highlight the current page? In other words, add a "current" class to the a element of the current page. Here's my code: <div id="nav"> <ul> <li><a href="../articles/">Articles</a></li> <li><a href="../photos/">Photos</a></li> <li><a href="../info/">Earthquake Info</a></li> </ul> </div> I've researched several different approaches, but most of them rely on linking to pages (i.e. articles.html ) instead of directories (i.e. ../articles/ ). I've seen the body/ID class

Sort divs based on values of child elements

亡梦爱人 提交于 2021-02-10 14:19:25
问题 I would like to sort the .choice_result divs based on the value of their .score child value. So with my js below, the .choice_result with a .score inside of 100%, should be the first div and not the last. Here's the js: <div class="poll poll_answered"> <div class="poll_div"> <h1><strong>Percentages</strong></h1> <div class="poll_results" style="display: block;"> <div class="choice_result" data-choice_percent="0"> <p class="choice_result_text">First<p> <div class="choice_result_width"> </div>

Why, using @HostListener, keypress event fires a number of time equal of the times the page is visited (ionic2/typescript)?

点点圈 提交于 2021-02-10 14:13:36
问题 I have a page in ionic 2 and I want to catch key pressed when the user is in the page. This is the code I used to do this (.ts) @Component({ selector: 'page-play', templateUrl: 'play.html' }) export class PlayPage { @HostListener('document:keypress', ['$event']) handleKeyboardEvents(event: KeyboardEvent) { console.log("keypressed!"); } constructor() { // doing a lot of things } } Unfortunately, the handleKeyboardEvents gets fired once the first time I enter in the page, twice if, after that,