Direction aware hover effect

Direction Aware Hover Effect

In today’s post I am going to show that how to create a direction aware hover effect using css3 transition and jquery. The goal is to make a little overlay along with a thumbnails from the direction that we are coming with the mouse on it. And if we are leaving the element overlay will slide out to that direction again from where it is coming. This going to get a beautifull and interesting effect by this.

We’ll use an unordered list for the thumbnails and the description overlays:

HTML:-

 

All the items will be floating in the left side and have a relative position because we are making description overlay in absolute position along with items.

CSS:-

 

What we have to do: It is depending from which direction we are entering the mouse, for this we initially set a respective “from” style which will set the correct initial position for the mouse entrence. After this we will apply css3 transition and then final style on it, due to this slide will slide in accordingly. We are are leaving the element, will apply again “from” for respective styling so that slide can slide out from the direction of mouse entrence and remove the final styling:

Javascript code for the following is given below:

Leave a Reply

Your email address will not be published. Required fields are marked *