Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #40451
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: CSS scale transform using javascript? |
| Date | 2021-09-29 11:52 +0100 |
| Organization | A little, after lunch |
| Message-ID | <sj1gh6$gb$1@dont-email.me> (permalink) |
| References | (12 earlier) <sin8qe$mj2$1@dont-email.me> <8a8e44c8-c534-457d-a9bf-0360db51321en@googlegroups.com> <sinagm$31t$1@dont-email.me> <70fb9c28-1e7e-40e4-92e3-0f685eb9a72an@googlegroups.com> <c9aa6bce-b78b-41d4-9e6e-7a663a50cff2n@googlegroups.com> |
On 29/09/2021 10:24, Jonas Thörnvall wrote:
> tisdag 28 september 2021 kl. 21:36:15 UTC+2 skrev Jonas Thörnvall:
>> lördag 25 september 2021 kl. 16:08:27 UTC+2 skrev The Natural Philosopher:
>>> On 25/09/2021 14:46, Jonas Thörnvall wrote:
>>>> lördag 25 september 2021 kl. 15:39:31 UTC+2 skrev The Natural Philosopher:
>>>>> On 25/09/2021 12:49, Jonas Thörnvall wrote:
>>>>>
>>>>>>
>>>>>> So far the only thing that will scale it uniformly is.
>>>>>>
>>>>>> html {
>>>>>> transform: scale(0.5,0.7);
>>>>>> }
>>>>>>
>>>>>> So maybe one should have a script that invoke different CSS files deipendent on resolution.
>>>>>> It seem idiotic to me, but....
>>>>>>
>>>>> var x = document.getElementsByTagName("HTML")[0];
>>>>>
>>>>> x.style.transform="scale(0.5,0.7)";
>>>>
>>>> Yeah but it doesn't work....
>>>>
>>> It does, I tested it
>>>
>>> <!DOCTYPE html>
>>> <html>
>>> <body>
>>>
>>> <h3>A demonstration of how to access an HTML element</h3>
>>>
>>> <p>Click the button to scale the document.</p>
>>>
>>> <button onclick="myFunction()">Try it</button>
>>>
>>> <p id="demo"></p>
>>>
>>> <script>
>>> function myFunction() {
>>> var x = document.getElementsByTagName("BODY")[0];
>>> x.style.transform = "scale(0.5,1.3)";
>>> }
>>> </script>
>>>
>>> </body>
>>> </html>
>>>
>>>
>>> --
>>> There’s a mighty big difference between good, sound reasons and reasons
>>> that sound good.
>>>
>>> Burton Hillis (William Vaughn, American columnist)
>> Just for fun i added sliders for scaling, but to be useful I should created another slider resolution for it "CSS" i used the midi i already had 0-127 so it isn't exactly finetuned zoomwise.
>> But one wonder if one could keep them locked outside "the scaling document".
> Well locked positonwise.
>
yes.
essentially you are scaling with the above code the HTML entity called
'BODY'
You could create a <div ID ="SCALEME"> inside that and scale that using
document.getElementById("SCALEME")
instead.
You need to read up on the DOM in Javascript. Eacg nested HTML object,
is a Document Object Module and can be selected by name, tagname, ID or
class. If that selects more than one, you get an array that you can loop
through.
Then everything inside the object is accessible by javascript.
--
All political activity makes complete sense once the proposition that
all government is basically a self-legalising protection racket, is
fully understood.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-23 06:53 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-23 07:00 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-23 07:01 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-23 07:37 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-23 08:50 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-23 12:12 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-24 14:16 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-24 06:58 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-24 16:15 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-24 11:34 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-25 09:49 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-24 11:38 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-25 09:50 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 04:27 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 04:49 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 04:56 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-25 14:39 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 06:46 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-25 15:08 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 11:32 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 11:39 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 11:46 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 13:27 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-28 12:36 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-29 02:24 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-29 11:52 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-29 04:21 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-29 05:43 -0700
Re: CSS scale transform using javascript? The Natural Philosopher <tnp@invalid.invalid> - 2021-09-29 15:04 +0100
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 05:13 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 05:18 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 05:19 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 05:21 -0700
Re: CSS scale transform using javascript? Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-09-25 05:22 -0700
csiph-web