I have implemented a code with the following characteristics:
The navigation items' texts are hidden behind certain Divs, which I refer to as Navigation Divs.
When the mouse hovers over these pixels (navigation Divs), the text that is behind them slides right and left, and in some cases moves up or down about 15px using the animate() method...
When the mouse moves to another Div, the other text should reset to its original position for the next action. I achieved this by using:
$(document).on('mouseover', '.pixel#p18', function(){ $('.submenus').not("this Div's TEXT").fadeOut('fast').removeAttr('style'); });/* This Div's Text is just an example*/
I have applied this kind of setup for all of my navigation texts..
However, I am facing a problem:
When I hover the mouse on one of the navigation Divs, some of the texts that were not animated become visible due to removeAttr('style')!!! And I don't want that to happen...
Is there any alternative way to slide the texts or other elements to the left, right, top, and bottom with customizable values of movement...??? For example, sliding 23px to the left or 17px to the top... etc.? I am familiar with slideUp and slideDown but I'm not sure if they are suitable for my code...
Do you have any better ideas for this---you probably do because I think what I have currently is very poor
Lastly, why are my codes running so slow? The animations I have implemented sometimes lag, and I'm unsure whether it's due to my selectors or other factors.