Jump to content


Photo

Alterar Classe Css


  • Faça o login para participar
7 replies to this topic

#1 marceloplis

marceloplis

    Novato no fórum

  • Usuários
  • 12 posts
  • Sexo:Não informado

Posted 27/10/2006, 14:59

Pessoal, gostaria de saber se tem como fazer, por meio do JavaScript, a alteração de atributos de uma classe do meu css, por exemplo:


   (CSS)
	.cor{
		  background :#FFFFFF;
		  color		   :#000000;
	}

   
   (JavaScript)  ?????  Fazer algo assim:
   function muda(){
		 var classe = class.cor;
		 if( classe.background == #FFFFFF){
			  classe.backgraund = #000000;
			  classe.color		   = #FFFFFF;
		 }else{
			  classe.background = #FFFFFF;
			  classe.color		   = #000000;
		 }
  }

   (JSP)
   <input type="button" onclick="muda();">
   <div class="cor"></div>
   <div></div>
   <div class="cor"></div>
   <div></div>  
	

Gostaria de uma função que ao clicar no botão mudaria o valor dos atributos de uma classe CSS, assim todos meu elementos que estão usando esta classe sofreriam esta alteração.

Edição feita por: marceloplis, 27/10/2006, 16:31.


#2 bdoweb

bdoweb

    Super Veterano

  • Usuários
  • 1641 posts
  • Sexo:Masculino
  • Localidade:São Paulo - SP

Posted 27/10/2006, 16:23

pq naum muda a class de todo o elemento ....

document.getElementById("elemento").className = "novaClasseCSS";


[]'s
Quer ajuda seus amigo e ainda ganhar uma graninha?
Acesse agora mesmo http://yeapiz.com

#3 marceloplis

marceloplis

    Novato no fórum

  • Usuários
  • 12 posts
  • Sexo:Não informado

Posted 27/10/2006, 16:42

Cara, funcionou, mas não exatamente do jeito que eu gostaria. Veja o código abaixo:

eu gostaria que funcionasse como se estivesse usando a propriedade "display: none|block", mas este qdo executado no Firefox ou Opera bagunça a tabela, no IE fica certinho, mas vendo as especificações da W3C a propriedade "display: none|block" não deve ser usado em colunas de tabela <td>.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">

.oculto{
	visibility	: hidden;
}

.exibe{
	visibility	: inherit;
	background	: #C0C0C0;
	color		: #FFFFFF; 
}

</style>
<title>Table Collum</title>
</head>
<body>
	<script language="javascript">
		function showContent(){
			var par  = document.getElementById("mytable");
			var tds  = par.getElementsByTagName("td");
			for(x = 0; x < tds.length; x++){
				if(tds[x].id == "esc"){
					if(tds[x].className == "oculto"){
						tds[x].className = "exibe";
					}else{
						tds[x].className = "oculto";
					}
				}
			}
		}
	</script>
	
	<input type="button" value="Teste" onclick="showContent();">
	<table id="mytable">
		<tr>
			<td>Coluna 1</td>
			<td>Coluna 2</td>
			<td id="esc" class="oculto">Coluna 3</td>
			<td id="esc" class="oculto">Coluna 4</td>
			<td>Coluna 5</td>
		</tr>
		<tr>
			<td>Coluna 1</td>
			<td>Coluna 2</td>
			<td id="esc" class="oculto">Coluna 3</td>
			<td id="esc" class="oculto">Coluna 4</td>
			<td>Coluna 5</td>
		</tr>
		<tr>
			<td>Coluna 1</td>
			<td>Coluna 2</td>
			<td id="esc" class="oculto">Coluna 3</td>
			<td id="esc" class="oculto">Coluna 4</td>
			<td>Coluna 5</td>
		</tr>
		<tr>
			<td>Coluna 1</td>
			<td>Coluna 2</td>
			<td id="esc" class="oculto">Coluna 3</td>
			<td id="esc" class="oculto">Coluna 4</td>
			<td>Coluna 5</td>
		</tr>
		<tr>
			<td>Coluna 1</td>
			<td>Coluna 2</td>
			<td id="esc" class="oculto">Coluna 3</td>
			<td id="esc" class="oculto">Coluna 4</td>
			<td>Coluna 5</td>
		</tr>
		<tr>
			<td>Coluna 1</td>
			<td>Coluna 2</td>
			<td id="esc" class="oculto">Coluna 3</td>
			<td id="esc" class="oculto">Coluna 4</td>
			<td>Coluna 5</td>
		</tr>		
	</table>
</body>
</html>


#4 Miguceamma

Miguceamma

    Super Veterano

  • Usuários
  • 10443 posts
  • Sexo:Masculino
  • Localidade:Oruro

Posted 18/09/2017, 09:17

875 Mg Amoxicillin cheap cialis Fda Approved Canadian Pharmacies
Cialis On Sale In Usa
Pharmacie Andorre Kamagra <a href=http://cialtobuy.com>online pharmacy</a> Amoxicillin Clavulanic Acid Suspension 600 Mg
Terazoxin 2mg cialis Cialis Kaufen Serios
Venta Cialis Marca Zovirax No Prescription Canada
Diflucan Prescriptions <a href=http://cialtobuy.com>cialis</a> Buy Kamagra Jelly India

#5 Miguceamma

Miguceamma

    Super Veterano

  • Usuários
  • 10443 posts
  • Sexo:Masculino
  • Localidade:Oruro

Posted 03/11/2017, 02:53

Acquisto Viagra Legale Sildenafil 50 Mg Generico viagra online prescription Buy Brand Cialis Online Ireland
Buy Synthroid Online No Prescription Canada Generic Tab Provera Get Website Without A Script Viagra Generique Au Maroc viagra Zithromax Sore Throat Dosage Order Synthroid Pills
Quibron T Swanson Health levitra 10 mg generic Viagra Ohne Rezept Niederlande Celecoxib

#6 RonsisM

RonsisM

    Super Veterano

  • Usuários
  • 13572 posts
  • Sexo:Masculino
  • Localidade:Plovdiv

Posted 03/11/2017, 06:18

Medicamento Levitra Precio viagra online pharmacy Adalat Canada Prescription Drugs
Finasteride Generic Uk Cuanto Cuesta La Viagra En La Farmacia viagra Vendita Cialis Natural A Propecia

#7 LarPhozyHah

LarPhozyHah

    Super Veterano

  • Usuários
  • 13025 posts
  • Sexo:Masculino
  • Localidade:San Miguel de Tucuman

Posted 03/11/2017, 10:48

Prix Levitra Pharmacie Belgique Come Comprare Cialis Senza Ricetta Levitra Helps Premature Ejaculation viagra online prescription Icd E Viagra Combien Temps Avant Cialis Brand 20 Mg Original
Cialis Esiste Il Generico Cardura viagra Se Vende Viagra En Farmacias Sin Receta
Erection Pills Medication Zithromax Cialis Generico On Line Italia buy viagra online Je Prends Amoxil

#8 hapedlok

hapedlok

    12 Horas

  • Usuários
  • 232 posts
  • Sexo:Feminino
  • Localidade:Brisbane

Posted 04/11/2017, 07:55

Discounts! best beauty products 2017 progect13.jpg Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked! If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included). buy.png READ MORE 7 ( 23.45 $)Bostanten fashion genuine leather backpack women bags preppy style backpack girls school bags zipper shoulder women's back pack ( 70.99 $)lunar 1New arrival Guarantee genuine leather men messenger bags casual business small shoulder bags for men cross body travel bags ( 44.00 $)Water Drop-shaped Necklace Pendant Case for Xiaomi Miband / 1S ( $1.83 )аккаунт battlefield 4H222 Black Fabric and Leather Shoe ( 110.00 $)LERAVAN Magic Touch Sticker - Sport Version-15.05 $Original GitUp Suction Cup Mount ( $3.17 )2016 Men Travel Bags Black Blue Men Tote Shoulder Travel Bag Portable Men Handbags Big Weekend Bag Women Waterproof Duffle Bag ( 67.75 $)1A TP4056 Lithium Battery Charging Module DIY Accessories ( $0.49 )Casual u neck sleeveless printed loose-fitting women's tank top ( 11.87 $)Luffy hair 150 density glueless full lace human hair curly wigs for black women lace front virgin mongolian afro kinky curly wig ( 147.00 $)Wallets purse cute owl glasses hit color printing korean rounded zipper long women wallet new ladies' clutch card & id holders ( 10.58 $)13 Colors Hand-Woven Watch Ladies Quarzt Watches reloj New Brand Handmade Braided Relojes Friendship Bracelet Watches ( 2.24 $) 15bb.png
Discounts! www bestproducts

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Plus size round neck 3d watercolor rose printed short sleeve men's t-shirt ( 12.78 $)
Non-Mainstream Clear Lens Glasses Frame Vintage Student Leopard Print Eyeglasses Men Women Decoration Optical Lens Eye Frame W1 ( 1.30 $)
7a brazilian virgin hair body wave 3 bundles lot human hair weave brazilian hair weave bundles brazilian body wave virgin hair ( 52.50 $)
Kardiff, Dzhek
XiaoMi Mi Pad 2 16GB ROM-175.98 $
F69 Smart BT Swimming Watch-42.50 $
Signature Double Face Wool Blend Mens Scarf ( 75.00 $)
8a grade 4 bundles peruvian straight hair with closure peruvian virgin hair with closure straight virgin human with closure ( 37.00 $)
battlefield premium
Magnetic Levitation Photo Frame-29.30 $
Lapilli Murano Glass Necklace ( 82.00 $)
Free Shipping Camping outdoor survival equipment to make fire waterproof magnesium ribbon trumpet mini flint magnesium rod B1 ( 0.79 $)
17km 8 pcs set pu leather choker necklaces set for women steampunk collar lace necklace jewelry ( 2.39 $)
Zhirinovskij posetoval na komfortnuyu situyu zhizn
Didicer Smart IR Thermometer APP Control Temperature Measurer-17.66 $


101bb.png
Discounts! best products in usa

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
Queen Hair Products Brazilian Virgin Hair Straight 100% Unprocessed Virgin Human Hair Weave Bundles FAST SHIPPING by QueenHair ( 60.00 $)
12v led car parking sensor monitor auto reverse backup radar detector system + led display + 4 sensors + black + silver ( 33.40 $)
тим фортресс 2 оливия манн порно
45X Telescopic Magnifier ( $3.69 )
SOCOOLE W08 Swimming Smartwatch Phone-62.60 $
Casual women's jewel neck short sleeve solid color slit dress ( 9.24 $)
Wireless home video door phone intercom doorphone doorbell system, 3.5 inch tft color monitor + 1 camera kit ( 114.48 $)
затяжка гбц ваз 2112
X-tiger flour green maillot cycling jersey bicycle wear ropa ciclismo rock bicycle uniform mtb bike clothing cycling clothes ( 50.89 $)
Kids Children Car Safety Seat Belts Adjuster Protector Cover Clip Booster Strap Harness Pads Car Accessories FISHBERG ( 2.37 $)
Ms lola wigs lace front wigs 130 density peruvian virgin hair body wave full lace short human hair wigs for black women ( 101.03 $)
2016 fashion new arrival gold ring vintage jewelry ring adjustable brass small arrow rings for women ( 0.99 $)
Hot sale portable outdoor picnic foldable gas burner camping mini ultralight steel stoves burners outdoor equipments ( 5.36 $)
Rogesi 2016 new casual women t shirts hooded long sleeve round neck short shirt women's clothing american apparel ( 22.90 $)
Discovery V8 3G Smartphone-71.39 $


93.png
Discounts! electronic product reviews

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
CONTACT'S 2016 Fashion Genuine Leather Men Briefcase Cowhide Men's Messenger Bags 14"" Laptop Business Bag Luxury Lawyer Handbags ( 72.12 $)
Tassel river rock mini saddle bag ( 363.23 $) Tory Burch
Hot sale tactical gloves outdoor full finger army gloves antiskid sports microfiber mens sports gloves ( 15.32 $)
Mens dark brown nubuk belt ( 82.68 $) Manieri
Gadget Softy Fabric and Leather Cosmetic Clutch ( 60.00 $)
LCD 4884 Joystick Shield V3 Module for Arduino Single Chip Microcomputer ( $6.73 )
F07554 3k carbon fiber 700mm folding rack frame kit 6 axle x700 for diy rc hexacopter quadcopter fpv multi-copter ( 113.85 $)
Ulefone Vienna Android 5.1 5.5 inch 4G Phablet Corning Gorilla Glass Screen MTK6753 64bit Octa Core 3GB RAM 32GB ROM Fingerprint ID HiFi Cameras 172.59$
Brazilian virgin hair straight 3 bundleslot unprocessed brazilian hair weave bundles 100% human hair brazilian straight hair ( 54.00 $)
Women Floral Canvas Bucket Casual Shoulder Bag Spanish Beach Bags Women String Shopping Handbags Lace Printing Bag Female Bolso ( 25.00 $)
secret weapons
ключ battlefield
Kabden 4L Waist Leg Pack Multipurpose Tactical Bag 13.39$
WIKILEAKS WL - 4405 Electric Heated Eyelash Curler-6.51 $
рецензия +на любую книгу


95.png
Discounts! a product review

progect13.jpg
Products which fall under this return policy can be returned domestically, as long as they are unused and in the original packaging. No questions asked!
If a product that falls under this guarantee is found to be counterfeit, you will get a full refund (shipping costs included).

buy.png

READ MORE
PU Leather Pocket Protective Case for iPhone 6 / 6S ( $9.16 )
Casual flat heel and lace-up design women's sandals ( 28.22 $)
Carteras mujer women wallet clutch wallet female case phone carteiras femininas money bag purse card holder ( 3.98 $)
Rose Gold Plated Mini Tiger Ring ( 79.00 $)
Wirelesswired gsm home security fire alarm system+pet inmune pir sensors+ door sensors remind+switch smart socket plug+curtain ( 132.99 $)
Vintage poster Gorilla bar counter adornment kitchen retro kraft paper posters,Movie poster Wall stickers 5135CM ( 2.59 $)
ASLING Protective Back Cover Case for Xiaomi 5 ( $3.59 )
Hillary Clinton on Syria, Putin &amp; election
Csgo new fade counter strike handmade hunting knives fighting claw knife tactical survival camping tool slaughter karambit knife ( 19.98 $)
No.99653 quartz watch with numbers and dots indicate leather watch band flower pattern dial for women - blue ( 2.97 $)
Stylish lapel long sleeve solid color slimming women's blazer ( 15.65 $)
+the legend +of zelda wii
50pcs bag very rare finger grape seeds organic heirloom fruit seeds natural growth grapes bonsai pot ( 0.45 $)
Best 100 wireless 8 wired,gsm alarm system,lcd screen home security alarm system with ios and andriod control ( 134.99 $)
Cell Phone Accessories Wholesale Online Store â TVC-Mall.com


129bb.jpg




0 user(s) are reading this topic

0 membro(s), 0 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq