![]() |
|
|
|||||||
| Register | Forum FAQ | Search | Today's Posts | Mark Forums Read |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Design Controls. Just like we did for the color.
CSS Properties to JavaScript Reference Heres a handy chart to use javascript to change style refs like we did here: onChange="document.getElementById('cardTemplate'). style.backgroundColor I assume you have or know how to google for a CSS chart? Lets move on: With Checkboxes, we have a little more complicated code HTML Code:
BOLD: <input type="Checkbox" name="BOLDcompanyName" value="yes" onMouseup="document.getElementById('companyName').style.fontWeight=(this.checked ? 'bold' : 'normal');">
This is an if/else in JS. (this.checked ? 'bold' : 'normal') fontVariant is italic or normal fontSize ..... This is where a select works better. ... and again, the syntax is not as straightforward as we would like. HTML Code:
FONT: <select name="SIZEcompanyName" onChange="document.getElementById('companyName').style.fontSize=this.options[this.selectedIndex].value;"> <option value="8pt">8 point</option> <option value="10pt">10 point</option> <option value="12pt" selected>12 point</option> </select> style="font-size=12pt;" in your TD to have your initial text show it properly. Optionally, you can do this as your 1st select option HTML Code:
<option value="8pt"> -- Choose --</option> this.value becomes this.options[this.selectedIndex].value this.value works in IE, but not in Firefox, because they are Javascript, where IE is JScript. Last edited by jmarcv; 10-25-2007 at 05:43 PM. Reason: add title |
|
||||
|
John-Marc,
I have added the option for bold and tried to add the fontVariant for italic but am unable to get this working. HTML Code:
<td width="250"><input name="slogan" id="slogan" type="text" tabindex="6" size="25" maxlength="100" onChange="document.getElementById('sloganS').innerHTML=this.value;" /> <br /> Italic: <input type="Checkbox" name="ItalicsloganS" value="yes" onMouseup="document.getElementById('sloganS').style.fontVariant=(this.checked ? 'italic' : 'normal');"></td> Form A couple of questions: How do the other designers allow for non-browser type fonts to be displayed in the preview? Do they have to somehow have these fonts called from an external programming file? Example I eventually want to make the background colors to background images, (from the CSS Properties to Javascript Reference you posted) - I believe that would be backgroundImage - but I am unable to find the syntax for the code to select an image verses the hex code for the color... can you direct me to a resource. I am so stoked about learning this coding! You are a phenomenal teacher also. I've read many a post where the programmers are not as patient. Thank you for the invaluable knowledge - I won't forget your kindness. I'm sure all of us that are learning these "foreign languages" are very thankful for the help! |
|
||||
|
onClick it is then. Guess I got the wrong one. Theres one that needs mouseup.... forgot now,
oops... fontVariant - Google Search its fontStyle, not fontVariant. Quote:
But..... One way is 'flash', which is something I never got very good at. The other way is to upload fonts to the server and use imagemagick to create graphics out of the text. Congrats on the back image! |
|
||||
|
Here is an article: Web Design Guides: Font Embedding, SSI-Developer.net
__________________
::::: 01001100 00110011 00110011 00110111 |