juli
juli

Reputation: 71

jquery help with back to top

why is this not working?

<script type="text/javascript">     
jQuery.noConflict();

jQuery(document).ready(function(){
   if( jQuery(".page").height() < jQuery(window).height() ) {
       jQuery(".backtop").hide();
   }
   else {
       jQuery(".backtop").show();
   }
});
</script>

I'm using two frameworks, mootools and jquery. I don't know how to use mootools and it must be there. I know a little of jquery and just want the "back to top" button to appear when the body (.page) is bigger than the window.

Can anybody help me???

EDIT: CAN ANYONE GIVE ME A MOOTOOLS SIMILAR SCRIPT?????

Upvotes: 3

Views: 270

Answers (2)

Mindfulgeek
Mindfulgeek

Reputation: 141

Is .backtop a class or the id of the element? to access the id try $("#backtop").hide();

Good luck and HTH. -- Joe

Upvotes: 0

sathis
sathis

Reputation: 547

http://jsfiddle.net/yyEPR/

This code works.I copied the code from http://briancray.com/2009/10/06/scroll-to-top-link-jquery-css/

Upvotes: 1

Related Questions