• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to change stylesheet directly?

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good day!

My original problem was how to make the hiding or my elements faster.
I was directed to post my problem to this forum.

https://coderanch.com/t/259491/Applets/java/Applet-speed-up-hiding-elements

And Ulf's suggestion was:
There are ways to change the stylesheet directly, so that all elements that are part of a particular class are changed all at once.

How can I do this?

Thanks.
 
Sheriff
Posts: 67749
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Much more common, is changing the class of a root element to effect a change of multiple elements without having to change the class of each one.

For example, let's say that you wanted to hide all images on a page. Rather than finding and hiding all the images, just put the class hiddenImages on the <body> tag and have CSS rule:



Remove the class to make them re-appear.
[ June 29, 2008: Message edited by: Bear Bibeault ]
 
They worship nothing. They say it's because nothing is worth fighting for. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic