From: Denis McMahon on 30 Jul 2010 17:52 On 30/07/10 21:23, Don wrote: > I thought a "minus-sign" had the same character-code as a "hyphen". In javascript, if it's not in quotes, it's a minus sign. If it is in quotes, you can call it minus or hyphen or dash or whatever else you like. Rgds Denis McMahon
From: Luuk on 30 Jul 2010 19:04 Op 30-07-10 22:24, Don schreef: > On Fri, 30 Jul 2010 21:13:07 +0100, Tim Streater<timstreater(a)waitrose.com> wrote: > >> In article<1tb6569c4mgtojagnjthf8v95jh18gcfun(a)4ax.com>, >> Don<no(a)adr.com> wrote: >> >>> I need to dynamically change a rule's "margin-top", but I get a JS error on >>> the following. JS doesn't seem to like the hyphen in "margin-top". It works >>> for other style properities, e.g., "width". >>> >>> document.styleSheets[0].rules[7].style.margin-top = "200"; >> >> If you google for margin-top you'll probably find a site that tells you >> the equivalence between the CSS atttribute and the JavaScript >> equivalent. Such as: >> >> document.styleSheets[0].rules[7].style.marginTop = 200 + "px"; > > > That works! I've spent the past hour on this, googling and experimenting. I thought I tried "marginTop", but maybe I didn't. Some days are just a bear! > Thanks, for your help Tim. I appreciate it! > > Don than you need a crash-course in Google: http://lmgtfy.com/?q=css+margin+top+javascript&l=1 1st link is going to: http://www.w3schools.com/css/pr_margin-top.asp and there's the info about "margintop"....... -- Luuk
From: John G Harris on 31 Jul 2010 12:48 On Fri, 30 Jul 2010 at 13:23:38, in comp.lang.javascript, Don wrote: >On Fri, 30 Jul 2010 21:16:42 +0100, Tim Streater <snip> >>By the way that's not a hyphen. It's a minus sign which is why JS is >>bleating. > I thought a "minus-sign" had the same character-code as a "hyphen". No. ASCII has a minus sign. A hyphen is longer and ASCII doesn't have one. John -- John Harris
From: Hans-Georg Michna on 31 Jul 2010 13:45 On Fri, 30 Jul 2010 13:23:38 -0700, Don wrote: > I thought a "minus-sign" had the same character-code as a "hyphen". Far from it. Check http://www.cs.tut.fi/~jkorpela/dashes.html for more info. Hans-Georg
From: Dr J R Stockton on 31 Jul 2010 18:13 In comp.lang.javascript message <timstreater-5DDBF9.21451030072010(a)news. individual.net>, Fri, 30 Jul 2010 21:45:10, Tim Streater <timstreater(a)waitrose.com> posted: > >I mean to say that JS knows nothing about hyphens and plenty about >minus-signs. IIRC, without checking at www.unicode.org, Unicode has a character position for minus and another for hyphen. Computer programmers and most typists use neither of those, but use \x2D which is generated by a keyboard key directly. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 7. Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Command-prompt MiniTrue is useful for viewing/searching/altering files. Free, DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Namespace Array Next: can I make Javascript see binary data? |