SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Posts
    31
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Some Basic Javascript Problem

    Hello everyone,

    Im new to javascript&jquery and im trying to implement a new form of contact.

    The page is this one:

    http://gritodarua.com/new/

    The javascript code im using:

    Code:
    var showingContact = false;
    
    //setButtons
    $("a[rel=contact]").click(openContact);
    
    //setContact
    //$("#form .close").click(closeContact);
    
    function openContact(){
    if(showingContact) return;
    showingContact = true;
    $("div#contact").css({display:"block", top:-700});
    $("div#contact").stop().animate({top:formY},800,"easeOutQuint");
    }
    It wont aplly the css to the div or animate when i click on the link, someone have an ideia?

    Thank you

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,192
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    The following variable highlighted in red is undefined, simply create this or set the value within the object.

    Code:
    $("div#contact").stop().animate({top:formY},800,"easeOutQuint");

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2011
    Posts
    31
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much!

    Functioned like a charm!


Bookmarks

Posting Permissions

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