Jump to content


- - - - -

:After Psudeo and Animations


  • Please log in to reply
4 replies to this topic

#1 Mr-Sim

Mr-Sim

    Airline Transport Pilot

  • Members
  • PipPipPipPipPipPip
  • 3,914 posts
  • Location:West Midlands

Posted 28 September 2011 - 12:13 PM

So within CSS you can use

-webkit-transition: 500ms;   
	-moz-transition: 500ms;

to create a smooth hover effect. Only problem is this doesn't work with the :after / :before psudeo classes. Are there any alternatives?

#2 -Dexter

-Dexter

    Supersonic

  • Members
  • PipPipPipPipPipPipPipPip
  • 20,183 posts
  • Location:West Virginia, USA

Posted 28 September 2011 - 09:14 PM

Works fine in Firefox 7: http://jsfiddle.net/F97dP/1/

(Excuse the 5 minute code mess)

Edited by -Dexter, 28 September 2011 - 09:17 PM.


#3 Mr-Sim

Mr-Sim

    Airline Transport Pilot

  • Members
  • PipPipPipPipPipPip
  • 3,914 posts
  • Location:West Midlands

Posted 29 September 2011 - 02:07 AM

Sorry, I didn't really say what I meant. Using that -moz-transition & -webkit-transition:250ms;, Ed. Remember that? :hrmm: For example I've used it with the word facebook and that has a logo applied using :before. The text has a smooth nice hover animation but the logo doesn't take advantage of it. Its a sudden hover.

#4 -Dexter

-Dexter

    Supersonic

  • Members
  • PipPipPipPipPipPipPipPip
  • 20,183 posts
  • Location:West Virginia, USA

Posted 29 September 2011 - 08:38 AM

Can you post your code? I would help you over IM, but I think it's better to do it here so others can benefit in the future.


I think you're asking if CSS can fade images. The answer is no, since images aren't dynamic. You would need javascript to decrease the opacity of the first image and increase the opacity of the second image when the user hovers.

Edited by -Dexter, 29 September 2011 - 08:43 AM.


#5 Prash

Prash

    Orville Reincarnate

  • Members
  • PipPipPipPipPipPipPip
  • 5,317 posts
  • Location:UK, England

Posted 29 September 2011 - 08:40 AM

Alternative are pretty simple JavaScript if you can't get it done with the CSS3. As Ed said, post up your code. I'm still not sure what you're trying to achieve.