Prev: search engine sitemap
Next: DW8 & Javascript problems
From: darrel on 30 Mar 2007 10:30 > Does anybody know how to do this, or where there is a source for it > online? > I've heard something about 'style objects' but don't know anymore. <img src="yourimage" style="border: 1px solid black;" /> -Darrel
From: Shane H on 30 Mar 2007 10:37 Change this in your Javascript - document.write('<img src="'+theImages[whichImage]+'">'); to this - document.write('<img src="'+theImages[whichImage]+'" style="border: 1px solid #000000">'); -- Shane H shane(a)NOSPAMavenuedesigners.com http://www.avenuedesigners.com ============================================= Back for 2007, close-up magic: http://deceptivemagic.com Web dev articles, photography, and more: http://sourtea.com ============================================= Proud GAWDS member http://www.gawds.org/showmember.php?memberid=1495 Delivering accessible websites to all ... ============================================= "martianarm" <webforumsuser(a)macromedia.com> wrote in message news:euj6jb$kpu$1(a)forums.macromedia.com... > Hi > Yes, this isnt' a forum about Javascript, but I don't know where else to > go. > I'm building a site and I have a piece of javascript to display a random > image > on the page. > Here it is http://www.rachel-martin.com/nf/013index.html > That's all working well, however, I'd like to apply a style to the image > (just > a black border round the edge). > > Does anybody know how to do this, or where there is a source for it > online? > I've heard something about 'style objects' but don't know anymore. > > Thanks very much in advance. > Rachel >
From: martianarm on 30 Mar 2007 10:44 Thanks for the reply, but I need something in Javascript, as it needs to apply to the javascript function.
From: Joe Makowiec on 30 Mar 2007 10:52 On 30 Mar 2007 in macromedia.dreamweaver, martianarm wrote: > Thanks for the reply, but I need something in Javascript, as it > needs to apply to the javascript function. Actually, it doesn't. The image written by the script is contained within a div with an id, so you can target it using CSS: #content_centre_left img { border : 3px dotted lime; } Alter to suit. -- Joe Makowiec http://makowiec.net/ Email: http://makowiec.net/contact.php
From: darrel on 30 Mar 2007 10:54
> Thanks for the reply, but I need something in Javascript, as it needs to > apply to the javascript function. CSS doesn't apply styles to javascript. It applies styles to HTML elements. Your javascript is producing an HTML element (the A tag) and, as such, the style needs to apply to the tag, not the javascript. Both Joe and Shane provide some more details for you. -Darrel |