1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Jquery Issues

Discussion in 'jQuery' started by dvncfll01, Jan 18, 2009.

  1. #1
    Umm I think this is the right spot, but I really need help heh

    Well what I am trying to do is make this box fade in 5 seconds, but it isn't working.

    This is what I got so far:
    $(function() {
    $("#Clickme").click(function() {
    $("#Box").fadeout(5000);
    });
    });

    And it isn't working, I think I type every thing right, but I don't know I'm lost :/
     
    dvncfll01, Jan 18, 2009 IP
  2. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #2
    Let's use the traditional function lol
    
    function fadeMe() {
       $("#Box").fadeout(5000); 
    }
    
    Code (markup):
    And add "fadeMe()" to onclick event.
     
    xrvel, Jan 19, 2009 IP
  3. dvncfll01

    dvncfll01 Active Member

    Messages:
    608
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Wait I'm confused lol i got it so when div id="click me" is clicked the function would would be the box well fade out :confused: but im not getting your way fully :confused:
     
    dvncfll01, Jan 19, 2009 IP
  4. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    [COLOR="Red"][I]$(function() {[/I][/COLOR]
    	$("#Clickme").click(function() {
    	$("#Box").fadeout(5000);		
    });
    [COLOR="Red"][I]});[/I][/COLOR]
    
    Code (markup):
    remove the red parts...
    what you did, was create a function (with that first line) that would add all the functionality you wanted. But you never called this function .. so the click event never got attached..
     
    gnp, Jan 19, 2009 IP
  5. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #5
    Ok, what about this one, i hope this works. ;)
    
    $(document).ready(function() {
       $("#Clickme").click(function() {
          $("#Box").fadeout(5000);
       });
    });
    
    Code (markup):
     
    xrvel, Jan 19, 2009 IP
  6. dvncfll01

    dvncfll01 Active Member

    Messages:
    608
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Its still not working :/

    I have my Html like

    <div id="Clickme">
    <a href="#">Click Me!</a>
    </div>

    I could have it like
    <a href="#">Click Me!</a>

    and

    $(document).ready(function() {
    $("a").click(function() {
    $("#Box").fadeout(5000);
    });
    });

    but that also doest work and I really dont know what to do >_<
     
    dvncfll01, Jan 19, 2009 IP
  7. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi,

    this is happening because you the fadeout needs to be fadeOut
    (with a capital O)

    hope this will save you a few hair ;)
     
    gnp, Jan 19, 2009 IP
  8. dvncfll01

    dvncfll01 Active Member

    Messages:
    608
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #8
    Still not working :/

    its maybe how I linked my html to the js and jquery libary

    <script src="js/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/Java.js" type="text/javascript" charset="utf-8"></script>
     
    dvncfll01, Jan 19, 2009 IP
  9. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9

    hmm... not sure about the charset part ..

    try linking to it directly from the jquery site, to check if that is the issue

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    HTML:
     
    gnp, Jan 19, 2009 IP
  10. dvncfll01

    dvncfll01 Active Member

    Messages:
    608
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #10
    also not making it work :(
     
    dvncfll01, Jan 19, 2009 IP
  11. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #11
    can you please provide the whole html page as seen by a browser ?
    (view source)
     
    gnp, Jan 19, 2009 IP
  12. dvncfll01

    dvncfll01 Active Member

    Messages:
    608
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #12
    just push ctrl + U if your using FF or GChrome
     
    dvncfll01, Jan 19, 2009 IP
  13. gnp

    gnp Peon

    Messages:
    137
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #13
    :D

    i know how to view source.... but you have not provided a link ;)
     
    gnp, Jan 19, 2009 IP
  14. xrvel

    xrvel Notable Member

    Messages:
    918
    Likes Received:
    30
    Best Answers:
    2
    Trophy Points:
    225
    #14
    Are you sure you've had a div with "Box" as id (case sensitive) ?
     
    xrvel, Jan 19, 2009 IP
  15. paitken

    paitken Peon

    Messages:
    42
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #15
    What's the URL to the site. It's always easier to help that way. You're not clicking on the div, you would need to make it so that it applies to the URL when clicked. The URL would need to have <a href="..." id="Clickme">Click Me</a>
    <div id="box">
         <a href="blah" id="clickme">Click me</a>
    </div>
    HTML:
    JQuery:
    $(document).ready(function() {
        $('#clickme').click(function() {
            $('#box').fadeOut(5000);
         });
    });
    Code (markup):
     
    paitken, Jan 19, 2009 IP
  16. dvncfll01

    dvncfll01 Active Member

    Messages:
    608
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #16
    Oh awesome man it works thank you and everyone for help
     
    dvncfll01, Jan 19, 2009 IP
  17. paitken

    paitken Peon

    Messages:
    42
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #17
    No problem. It's not always easy using other people's code.
     
    paitken, Jan 19, 2009 IP
  18. elias_sorensen

    elias_sorensen Active Member

    Messages:
    852
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #18
    And you should probably use classes if you have multiple links. ;)
     
    elias_sorensen, Jan 20, 2009 IP