Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why isn't my javascript working?

    So I have been trying some basic jquery, but it doesn't seem to work.
    First 12 lines I'm trying to make my menu 10px bigger when hovering on it but it doesn't work.
    Lines 14-20 I'm trying to hide text and make it visible when holding mouse on a header.

    Zippyshare.com - kujundus.css

    Zippyshare.com - script.js

    Zippyshare.com - index.html

  • #2
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh sorry I made this post in the wrong forum and can't delete it:/

  • #3
    New Coder
    Join Date
    Jun 2014
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi buddy,

    First off, you haven't installed jQuery into your document, please apply the following tag BEFORE your other script tag.

    Code:
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    Also, your jQuery had 1 or 2 small errors, I have now corrected these.

    Code:
    $( document ).ready(function() {
    	$(".men66").mouseenter(function(){
    		$(".men66").animate({
    			height: "+=10px"
    		});
    	});
    	
    	$(".men66").mouseleave(function(){
    		$(".men66").animate({
    			height: "-=10px"
    		});
    	});
    	
    	$("#tekstid").hide(function(){
    		
    	});
    	$(".tekstikujundus").mouseenter(function(){
    		$("#tekstid").show()
    		});
    });
    Have a great day,

    Kieran.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •