Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Location
    Florence, Italy
    Posts
    153
    Plugin Contributions
    0

    Default Changing button images (a:hover) with CSS.

    I'd like to change the images of buttons (a:hover) using CSS instead of javascript.
    I've seen times ago a thread about this problem, but i'm not able to find it again.
    Thanks for help - Giovanni

  2. #2
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Changing button images (a:hover) with CSS.

    Hi Giovanni,

    I think the thread you've seen was the old (archived now) css-buttons support thread).

    The problem with hovering buttons is that IE (<= 6.x, don't know about v7) does not support input button hovering.

    A way around this problem is to wrap input buttons into <a>'s, and then, to prevent it to become a link that the browser will try to follow, set the href to "javascript:void(0);"

    An example of the HTML code is:
    Code:
    <a href="javascript:void(0);"><input type="submit" /></a>

  3. #3
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Changing button images (a:hover) with CSS.

    Obviously there is still some js left, but I assume that little piece of js is acceptable?

  4. #4
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Changing button images (a:hover) with CSS.

    Hmmmm.... I read about this a javascript:void(0) wrapper idea somewhere, but I never got to testing it. Today I decided to run a little test, and although it allows styling the input buttons nicely, there is one "minor" problem I ran into:
    the input buttons do not work anymore!

    Gonna do some more testing, but I have doubt if I will find a better solution than the exisiting js (other than dropping IE support ;-) )

  5. #5
    Join Date
    Mar 2006
    Location
    Florence, Italy
    Posts
    153
    Plugin Contributions
    0

    Default Re: Changing button images (a:hover) with CSS.

    I think I must explain better because ... I'm making some confusion!

    The target is to have a button that change shape in a:hover.

    To show a button zc use the function zen_image_button(.......).
    If I want use CSS (admin->configuration->layout settings->CSS buttons=yes) is called the function zenCssButton(....) that do not work well fo all the buttons, because work well only in the $type = 'submit', when it is inside a FORM block.

    The button "Tell a friend" is inside a FORM block, but the ACTION is for "add to cart", and it is not possible to insert a FORM block inside another FORM block.

    So I'd like to have simply a situation as

    .myclass a:link{... img1.gif...}
    .myclass a:hover{... img2.gif...}

    and after... I go in confusion because I don't know how to substitute the zen_image_button(.......) function with something else.

 

 

Similar Threads

  1. v151 Button Images in lieu of CSS-driven Text Buttons
    By smcelligott in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 4 Apr 2014, 12:37 PM
  2. Changing button images and types GIF to PNG
    By Jay Gee in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Oct 2009, 10:26 PM
  3. Quetions about Hover Bkgrund color and hover for images
    By Donn in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Nov 2007, 12:10 AM
  4. CSS Hover Buttons
    By hlycom99 in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 25 Jul 2007, 02:00 AM
  5. Changed button images - problem with search button
    By DVDTitan in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 May 2007, 04:58 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR