javascript variabel i html|Programmering / Grafisk formgivning|Forum|Nordichardware

Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
The forums are currently locked and only available for read only access
sp_Feed sp_TopicIcon
javascript variabel i html
Titan@Forum
Kommer du hit ofta?
Medlem
Forum Posts: 344
Member Since:
April 4, 2002
sp_UserOfflineSmall Offline
1
August 24, 2006 - 9:57 am
sp_Permalink sp_Print

Om jag har en varabel från ett javascript (tex myVar) som ligger i ett html dokument.
Hur gör jag för att använda den till att bestämma en div:s höjd?
Tex om myVar är 300 så vill jag att min div ska bli så många pixlar hög

ViU
Member
Medlem
Forum Posts: 4459
Member Since:
December 25, 2000
sp_UserOfflineSmall Offline
1071328
August 24, 2006 - 10:20 am
sp_Permalink sp_Print

getDocumentById('ID_PÅ_DIN_DIV').style.height=300;

torde fungera

zcorpan
Kommer du hit ofta?
Medlem
Forum Posts: 848
Member Since:
December 26, 2003
sp_UserOfflineSmall Offline
1071769
August 25, 2006 - 6:45 pm
sp_Permalink sp_Print
document.getElementById("foo").style.height = myVar + "px";
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1030
Currently Online:
Guest(s) 349
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967

 

Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL