NZAA
KPCKevin Powell - Community
•Created by NZAA on 6/2/2024 in #front-end
Javascript - Sort by Number
as the title suggests, I'm trying to sort by number. This is sorting by string? Any ideas?
if (order == "desc"){ e.target.setAttribute("data-order", "asc"); tableData = tableData.sort((a,b) => a[column] > b[column] ? 1: -1) } else if (order == "asc"){ e.target.setAttribute("data-order", "desc"); tableData = tableData.sort((a,b) => a[column] < b[column] ? 1: -1) }
14 replies
KPCKevin Powell - Community
•Created by NZAA on 5/19/2024 in #front-end
NAV Position Absolute of parent
I have a NAV bar with buttons on it. Each button is inside a container class. The container has position relative and as well as the button I have a box DIV which has 0 opacity until clicked. Once click it has opacity and position absolute.
The issue I have is my position absolute flows over and off the right of my screen giving me a overflow-x scrollbar or white space. How can I force is to flow left of the parent not outwards to the right?
2 replies
KPCKevin Powell - Community
•Created by NZAA on 3/16/2024 in #front-end
overflow-x scroll without scrollbar
I have a container with overflow-x: scroll. On mobile there's no scrollbar but I can grab and drag left/right to scroll.
I don't want a scrollbar on desktop but still want to be able to do this?
Is the solution? scrollbar-width: none;
Can I have a button to scroll left right even using JS ? If so how?
2 replies
KPCKevin Powell - Community
•Created by NZAA on 3/7/2024 in #front-end
Overlay gradient not working
Trying to understand why this isn't working.. i want the gradient to go below the parent DIV and blend into my page https://jsfiddle.net/fsp1omb5/
4 replies
KPCKevin Powell - Community
•Created by NZAA on 3/4/2024 in #front-end
JS Form Two Submit Options
I have a form using has a ID and JS file listening to the submit method.
I've got another JS code to change the ID field once the page is loaded. I'm then wanting to post that somewhere different. The issue is on page load the event listener is set on the first ID and even if I change it, that method is being called.
How can I reset this?
var form = document.getElementById('my-form');
form.addEventListener('submit', function(event) {
console.log('always called even if ID is changed after page load')
})
6 replies
KPCKevin Powell - Community
•Created by NZAA on 2/24/2024 in #front-end
How to make header cells full height
https://codepen.io/kodee/pen/WNmqMKQ
Trying to fix the first column or maybe two. When the content in other cells is taller I need to adjust my absolute ones, any suggestions?
4 replies
KPCKevin Powell - Community
•Created by NZAA on 2/16/2024 in #front-end
How to blend out a image?
I'm trying to achieve something like this with a photo. What's the best way to try this? https://i.pinimg.com/originals/f5/04/9d/f5049d576c1c03cc1ce79fe8ff835b37.jpg
13 replies
KPCKevin Powell - Community
•Created by NZAA on 2/9/2024 in #front-end
HTML/JS Table
Does anyone know html/js/css tables the website cricinfo.com uses?
Tables have frozen columns which work well on mobile etc.
1 replies
KPCKevin Powell - Community
•Created by NZAA on 11/9/2023 in #front-end
No width on my grid
This works on a desktop/laptop but on mobile IOS / chrome it has no width, why? https://jsfiddle.net/qd4gboj8/1/
22 replies