0

Can someone please verify if there is something wrong with this page, by clicking the X in the div, followed by clicking the word "reach.me".

What is suppose to happen is the div which you had previously closed should bounce in; that is not happening ?

4
Contributors
9
Replies
29
Views
3 Years
Discussion Span
Last Post by Siberian
0

Are you sure it was working for you, someone else I know tested and it didn't work. I changed the code around, the effect is not fluid and I am stumped as to why.

0

The effect you are looking for is not working because what is actually happening is that the page is being reloaded.

0

I dont understand how you can understand it and not at the same time, but I'll summarize it a bit more for you.

When you click on the "reach.me" link, its default behavior is to act as a link. Even though you didnt specify the target page using the href attribute, if you click on reach me, look at the browser carefully, you will see that it reloads the page. Well, when the page reloads, you see the div in question because you have it to visible on page load.

i see that you are trying to change the behavior of this link in your script.

$(".reachme a").click(function() {
    $("#reachme").animate({bottom: '-1600px'}, { duration:'2300px', easing: 'easeOutBounce' });
});

This isnt complete. im pretty sure ive suggested this to you on at least another thread, but i dont have time to look for it. What you need to do is prevent the link from reloading the page. You do this by using the event.preventDefault() method. here is an example..

$(".reachme a").click(function(event) {
   event.preventDefault();
   $("#reachme").animate({bottom: '-1600px'}, { duration:'2300px', easing: 'easeOutBounce' });
});

The event.preventDefault() method will stop the link from behaving like a link.

By the way, the "x" no longer closes the div. i dont see any js code to handle that type of event.

Edited by JorgeM

0

I was told to change the jQuery script due to another script I attempted on the page. I did remember the preventDefault syntax, what I could not remember is the order, I remember to give the function a parameter, that was about it.

I removed the jQuery close script, once again, I was informed it was clashing with the bounce script. The source for whom I'm getting this awful scripting information I will have to burn that bridge.

When I said, I understood, but didn't understand, it does sound like a oxymoron. What I meant is I was missing a syntax for which you brought to my attention.

I appreciate the help !

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.