0

I am creating a hover over button, once hovered it will scroll up to unreal more content over my slideshow, but when I hover over the button it pulls up but wont come back down.

Click here to see live, hover over Contact Our Team Button on slider

jQuery(".buttontwo").hover(
                    function(e){
                        jQuery('.buttontwo').animate({top:'0px', bottom:'auto'}, 200)
                        },
                    function(e){
                        jQuery('.buttontwo').animate({bottom:'75px', top:'auto'}, 200) 
                        }  
       );

Any ideas guys?

Thanks

1 Answer 1

1

Try adding a fixed value to the top property in the second function().

However you should be aware that as soon as you hover the button and the animation starts the second function will be triggered since you're not hovering the button anymore.

You might have to find a different way to animate that, perhaps adding aonMouseEnter / onMouseLeave event to the button's container.

Sign up to request clarification or add additional context in comments.

2 Comments

I cannot use a fixed value due to it being a responsive slider, it needs either top to be 0 and bottom to be 75px; Thanks for reply tho
You can work out where to move it based on the next element's position.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.