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 ?

Recommended Answers

All 9 Replies

Works for me..

That is odd, it is snap appearing for me !

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.

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

I understand, yet I don't understand ?

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.

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 !

Thanks Kaustav for the article !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.