Simple JavaScript Assistance needed.
I am new to Javascript and want to implement something which I think should be somewhat simple on my website. I have a link to my webpage below which I am testing on.
I am attempting to have a div appear afte the user starts scrolling.
Link to test page: Test 1 |
For my html I have:
<div id="mydiv">test div</div>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/test1.js">
</script> In my .js file I have:
$(window).scroll(function() {
if ($(this).scrollTop() == 0) {
$("#mydiv:visible").hide();
}
else {
$("#mydiv:hidden").show();
}
}); So I am not 100% sure why the error is there, and I am not 100% sure that my javascript is correct. It is a wordpress site if that matters.
Please please help me out. Thank you so much for your time, and sorry if this is a novice mistake.
-
mikeonrails -
[ 1 ] Thanks - 1 reply
{{ DiscussionBoard.errors[8302274].message }}-
jleavitt13 -
Thanks
{{ DiscussionBoard.errors[8304572].message }} -
-