SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jan 2014
    Posts
    23
    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
    23,592
    Mentioned
    411 Post(s)
    Tagged
    6 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.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,788
    Mentioned
    158 Post(s)
    Tagged
    3 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 Member
    Join Date
    Jan 2014
    Posts
    23
    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
    23,592
    Mentioned
    411 Post(s)
    Tagged
    6 Thread(s)
    Off Topic:

    Discussion moved here: http://www.sitepoint.com/forums/show...19#post5619419


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
  •