Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How can I create a toggle with icons?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42206
    AlirezaM
    Participant

    Hello to everyone!

    Guys, I have created this toggle with jquery library :

    http://jsfiddle.net/b59Su/

    Now the problem is I can’t change those + and – texts with icons.

    and I also want to have a different style for current item (which is selected)

    How can I do that?

    thanks in advance!

    Alireza.M

    #122143
    TheDoc
    Member

    You can do something like this: http://jsfiddle.net/b59Su/6/

    The next thing you’ll have to try to figure out is how to stop the users from double-clicking and having the color disappear!

    #122160
    greenrobo
    Member

    Here is how you can do it http://codepen.io/gitchandu/pen/moBKj

    #122200
    AlirezaM
    Participant

    Thank you very much greenrobo!

    It was exactly what I want.

    #122214
    AlirezaM
    Participant

    dear greenrobo!

    You have used 2 images for plus and minus signs with “center right” positions.

    What about 1 spritesheet?

    If I want to use 1 spritesheet for those signs how I should change the positions?

    #122220
    AlirezaM
    Participant

    Thank you scottnix!

    I used the code and got the result as I wished.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.