Can CSS import a javascript function?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dglickler
    New Member
    • Nov 2007
    • 1

    Can CSS import a javascript function?

    I have a website I'm about to begin coding.

    They want the background to fade from one picture to another and back agan.

    I have the javascript code that works to do this effect, no problem, easy peasy.

    It works if it's a regular image that I plunk down without CSS, so it's not a javascript issue.

    What I need to know is if it's possible to make this work from CSS. Namely...

    if I were doing this as a flat image, I'd put the image source code as:

    <img width="567" height="568" src="i/img_frontsailbo at_1.jpg" class="floatlef t" name="SlideShow " />

    I want to call this as a background from my CSS sheet.

    Now, I know to get a background image of this image I'd do this:

    #slideshow {
    background-image: url(../i/img_frontsailbo at_1.jpg);
    }

    Is there some way I can assign the "name=" type functionality so it calls in the javascript "SlideShow" as the image does in HTML?
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    No. CSS can only style the content of HTML and nothing else.

    Comment

    Working...