SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2014
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Progressive CSS - does this exist?

    This could be a strange question, but is it possible to have styles that change dynamically? i.e a links colour will increase tint by 0.1% everytime it's clicked. I'm guessing this is also going to involve some extensive javascript. If you could point me in the right direction that would be great. Cheers

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by eckul View Post
    a links colour will increase tint by 0.1% everytime it's clicked.
    Definitely a programming task, although even then, I don't think you'll get color values as fine as that, but I could be wrong.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,295
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Yes you would likely need js to do this but I guess if it's a link you are clicking to take you somewhere else then you will need to store a cookie each time the link is clicked to keep a record of what colour it should be so that it can updated each time.

    You can use hsla colours to make it easier to change programmatically.

    It would need a click event on the link which would then increment the colour and then store that colour as a cookie. On revisit the cookie would be read and the correct color re-instated.

    Seems like a job for the Javascript forum

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2014
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, i'll post in the JS forum

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,117
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Off Topic:

    Discussion moved here: http://www.sitepoint.com/forums/show...19#post5619419
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


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
  •