Results 1 to 4 of 4

Thread: Changing Image

  1. #1
    Join Date
    Sep 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Changing Image

    I am using a script in the scripting archive to change stylesheets with a dropdown menu. I have a logo on my site that I want to change color with the different chosen styles. How can I change the image with CSS?

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Huh? What image? With css?

    With JS it's easy:

    Code:
    <img src="image1.png" onmouseover="src = 'image2.png'" onmouseout="src = 'image1.png'">
    - Mike

  3. #3
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    You need to create multiple versions of the image to begin with. From there you apply the image as a background on a div(or equivalent) like so.I am going to assume you have a basic understanding of CSS. If not then I suggest you find a quick tutorial.
    Code:
    #logo{
    background: #FFF url('somegif.gif') center top no-repeat;
    }
    with html like this
    Code:
    <div id="logo"></div>
    Then just change the style in the alternate sheet.Another option is to use transparency(gif or png) in the image. Then set the background-color: property correctly.

  4. #4
    Join Date
    Sep 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I tried that but the the image won't appear on the second style. Only on the default style.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •