|
I guess this is the most relevant thread. I'm making something in <canvas> and I have two images. I want one to rotate and the other to stay still. Trouble is I can either make it where they both rotate or neither do.
|
# ¿ Mar 16, 2011 15:53 |
|
|
# ¿ Apr 29, 2024 13:35 |
|
Lumpy posted:Rotate the "still" image opposite the direction of the canvas context rotation I found a different tutorial and recoded my wheel, but now that one won't work in IE with excanvas
|
# ¿ Mar 17, 2011 14:26 |
|
Lumpy posted:I'm on my phone all week, so no code, but what you do in essence: Coworker found a different demo using it and it works now. Maybe that article you posted will shed some light onto why what I did earlier didn't work.
|
# ¿ Mar 18, 2011 03:17 |
|
Wheany posted:This isn't strictly a Javascript question, but is there a way to find the margin of an element if it has not been assigned from javascript?
|
# ¿ Sep 28, 2011 16:43 |
|
How do I get a textarea to have a limit of 500 words? Anything I've found in my searching either counts characters, not words; or doesn't actually work when I copy/paste the code. EDIT: Got IT Found a code that counted 500 words (well spaces really, I don't care about a double space bug). But it then erased to 500 characters for some reason. So I took that code and fixed it. The Merkinman fucked around with this message at 16:43 on Dec 15, 2011 |
# ¿ Dec 15, 2011 14:56 |
|
I've found Safari difficult to detect as it seems any Webkit browser also has "Safari" in its user agent. If you're going to do this, I'd suggest a "not your browser?" link which then shows all the different browsers and their instructions. User Agents really need to be cleaned up...
|
# ¿ Jun 14, 2012 14:43 |
|
Gazpacho posted:Well, keep in mind they got into this situation because of code that explicitly checked the browser ID, leading browser devs to spoof the browser ID for the sake of that short-sighted (or downright hostile) code. This is why the jQuery folks are working to eliminate the browser property. If user agents are just going to include the same strings and spoof each other, then what's the point of having them at all?
|
# ¿ Jun 15, 2012 15:08 |
|
But with HTTP2 you don't need to concatenate so Webpack is useless now.
|
# ¿ Jul 12, 2017 04:26 |
|
LifeLynx posted:I want to do something incredibly simple and commonplace, but I can't find an answer for it. I want to animate (fade-in and up) when an element would scroll into view. I can't find a vanilla JS or even jQuery answer for this, but maybe I'm trying to reinvent the wheel here? Is there a script anyone can recommend to do this fancy animate when scroll into view stuff with minimal bloat? Something like code:
|
# ¿ Jun 6, 2018 14:58 |
|
Saoshyant posted:Anyone familiar with Angular? I was trying to help a student working with it and, boy howdy, am I not experienced with this framework enough to figure out what we are doing wrong here. You might have better luck in the Modern Front-end Development thread, but I'll put in my two cents. If the URL parameters are changing, you need to subscribe to said changes. ngOnIt only fires once, so that's why no future clicks are doing anything. this should be a quick enough explanation. Whatever you want to happen when the menu is clicked, would go in place of the console.log(param)
|
# ¿ Aug 3, 2021 15:30 |
|
Saoshyant posted:The desired behavior is exactly what you described: responding to the routing data changing. There's a main menu being loaded in the app.component. That main menu routes to different components depending on what kind of subsection is listed, and every one of those components makes a call to a service (which calls a backend API to collect the data). Clicking once on a link like /dongs/Dong-1 works the first time, but if the user clicks on /dongs/Dong-2 nothing happens because the service call is in ngOnInit and it only fires once (and our unfamiliarity with the framework just got us as far as, "this is probably not the right way to do this"). What I posted was for query parameters /?dong=1, /?dong=2. What you are showing, /dongs/Dong-1, /dongs/Dong-2 are route changes, which are different but similar The Merkinman fucked around with this message at 18:03 on Aug 3, 2021 |
# ¿ Aug 3, 2021 15:56 |
|
Video Nasty posted:Typescript is way more fun but I'm stuck in Angular 1.5 land at my job and I make do. I'm sure you know this, but AngularJS is EOL
|
# ¿ Feb 19, 2022 13:55 |
|
Sab669 posted:I'm not even sure how to articulate this, but basically I'm wondering if it's possible to "instantiate" an Angular component from a string? Like if I have a component: Do you mean you want to have more control over dynamically loading a component? If so, look at this example, using createComponent
|
# ¿ May 12, 2022 19:18 |
|
Tea Bone posted:I've created a PWA with react. I'm not familiar with React, but what does the manifest.json look like?
|
# ¿ May 17, 2022 12:44 |
|
Tea Bone posted:Thanks, it's just the standard manifest that's generated by create-react-app: It's hosted somewhere via https right? Can you run it through Google Lighthouse, specifically the PWA section, to see if something is missing there?
|
# ¿ May 17, 2022 13:19 |
|
I was playing around with making a calendar, and I'm very confused about getDay(). I know 0 = Sun, it's not that. Why is it putting in an ISO string makes the value 1 less than it should be? JavaScript code:
|
# ¿ Mar 19, 2024 18:24 |
|
MrMoo posted:lol, use Luxon DateTime for anything more than fetching the current time. So because a time zone isn't defined, it's using a time zone where September 11, 2001 was a Monday? OK
|
# ¿ Mar 19, 2024 19:38 |
|
|
# ¿ Apr 29, 2024 13:35 |
|
Sab669 posted:Dumb Angular Question - and I'm phone posting so the code will be minimal, sorry. Can I have a type for row.td? What is canBeNA? a boolean? is it an optional boolean? right now cell.canBeNA ?? 80 will return either the value of cell.canBeNA or 80, which I don't think is what you want. Also if you're using Angular 17, you should use the Control Flow syntax, not that it's required to solve your issue. EDIT: I'm going to assume you should replace [style.width.%]="cell.canBeNA ?? 80" with something more like [ngStyle]="{'width' : cell.canBeNA ? '80%' : null}" The Merkinman fucked around with this message at 16:04 on Apr 9, 2024 |
# ¿ Apr 9, 2024 16:01 |