3

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?????

2
  • 1
    have you tried if(jQuery(document).height() < jQuery(window).height()) { ... }? Commented Aug 29, 2011 at 0:28
  • The only things I can recommend now are to print (with console.log()) jQuery(".page").height() and jQuery(window).height() OR create a test page with Mootools removed. There's a slight but possible chance of a conflict between the two libraries. Commented Aug 29, 2011 at 0:59

2 Answers 2

1

http://jsfiddle.net/yyEPR/

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

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

Comments

0

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

Good luck and HTH. -- Joe

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.