Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > How to access CSS list-style-image with JS?

Reply
Thread Tools

How to access CSS list-style-image with JS?

 
 
Joakim Braun
Guest
Posts: n/a
 
      11-10-2004
Given the CSS style:

li{list-style-image: url("someimage.gif")}

....how can I change the list-style-image for a given <li>, given an object
reference?

(I've unsuccessfully tried stuff like
theObject.style.list-style-image="url(someotherimage.gif)")

Joakim Braun


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-10-2004


Joakim Braun wrote:


> ...how can I change the list-style-image for a given <li>, given an object
> reference?
>
> (I've unsuccessfully tried stuff like
> theObject.style.list-style-image="url(someotherimage.gif)")


objectReference.style.listStyleImage = "url(image.gif)";
as with (nearly) any CSS property-name you need style.propertyName.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
Joakim Braun
Guest
Posts: n/a
 
      11-10-2004
"Martin Honnen" <(E-Mail Removed)> skrev i meddelandet
news:41925416$0$20930$(E-Mail Removed)-online.net...

<snip>
> objectReference.style.listStyleImage = "url(image.gif)";
> as with (nearly) any CSS property-name you need style.propertyName.


....aah, thanks. Had forgotten about that hyphen thing.

Joakim Braun


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM
Set CSS property equal to another CSS property? Noozer HTML 10 10-13-2004 09:20 PM
Is there a way to set the a CSS property to be explicitly the same as another CSS property? Joshua Beall HTML 1 12-10-2003 07:21 PM
print.css and screen.css tom watson HTML 1 09-09-2003 02:48 PM



Advertisments