SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Style a page upon leaving that page?

    Is there a way to apply styles to an element upon or just before leaving that page and going to a different page?
    For example, I have a fading out CSS3 Animation and I want to apply that right before a user leaves the current page to go to a different page in my site or to another page / site all together.

    I appreciate and welcome all and any help or comments regarding this.

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,197
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    You'd need JS to do that, but it sounds like it might be pretty annoying, as you'd have to prevent the user from leaving the page for a while, which would probably make me never want to visit your site again, TBH.

  3. #3
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, you're right. Now that I've had some time to think about it, I don't think that is a good user-experience at all. Thank you for helping me realise this / that !

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,366
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    IE had these in place since IE4 I believe (removed in IE9 fortunately) and came as standard in front-page and was the curse of many a webpage

  5. #5
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    732
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    yeah, i'm really glad @ralph.m bought me to my senses. I was really fascinated and obsessed with CSS3 Animations and wanted to do a fade-out upon leave, but when I realised that would prevent the user form reaching his / her goal ( in this case navigating to another page or leaving my site entirely ) I understood it was wrong of me to try to implement it and it would only make my visitors want to leave my site more.


Tags for this Thread

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
  •