#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Why doesn't this work?


    Can someone please help... I am pretty junior when it comes to JavaScript development and was wondering why this doesn't work?

    You can see the functionality at alanbrandt.com, hope someone can help!

    Cheers


    Code:
    <div class="social">
                <a href="javascript:void(0)" class="get-in-touch">get in touch</a>
                <ul style="display: block;">
                    <li></li>   
                    <li></li>   
                </ul>                
            </div>

    Code:
    e("a.get-in-touch")
            .click(function () {
            var t = e(this);
            if (t.hasClass("opened")) {
                t.siblings("ul")
                    .slideUp(300);
                t.removeClass("opened")
            } else {
                t.siblings("ul")
                    .slideDown(300);
                t.addClass("opened")
            }
            return !1
        });
    Code:
    footer#footer-main div.social a.get-in-touch {
      background: url(../images/expand-arrows.png) 100% 0 no-repeat;
      color: #787878;
      display: block;
      font-family: 'bryant_pro_mediumregular', Arial, sans-serif;
      font-size: 10px;
      letter-spacing: 1px;
      text-transform: uppercase;
      margin: 24px auto;
      padding: 0 2px;
      width: 110px;
      -moz-transition-duration: 0.2s;
      -webkit-transition-duration: 0.2s;
      transition-duration: 0.2s;
    }
    footer#footer-main div.social a.get-in-touch:hover {
      color: #454545;
      background-position: 100% -11px;
    }
    footer#footer-main div.social a.get-in-touch.opened {
      background-position: 100% -33px;
    }
    footer#footer-main div.social a.get-in-touch.opened:hover {
      background-position: 100% -22px;
    }
    footer#footer-main div.social ul {
      display: none;
      padding: 14px 0;
      overflow: hidden;
      zoom: 1;
    }
    footer#footer-main div.social ul li {
      float: left;
      width: 33.3%;
    }
    footer#footer-main div.social ul li a {
      color: #787878;
      float: left;
      font-family: 'bryant_pro_mediumregular', Arial, sans-serif;
      font-size: 10px;
      letter-spacing: 1px;
      line-height: 2.5;
      text-align: left;
      text-transform: uppercase;
      margin: 1px 0;
      padding: 0;
      width: 100%;
      -moz-transition-duration: 0.2s;
      -webkit-transition-duration: 0.2s;
      transition-duration: 0.2s;
    }
    footer#footer-main div.social ul li a:before {
      background: url(../images/social-icons.png) 0 0 no-repeat;
      content: " ";
      display: block;
      float: left;
      width: 24px;
      height: 24px;
      margin: 0 5px 0 0;
    }
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,031
    Rep Power
    377
    might have to do this:

    e("a.get-in-touch")
    .click(function (this) { //added this here
    var t = e(this);
    if (t.hasClass("opened")) {
    t.siblings("ul")
    .slideUp(300);
    t.removeClass("opened")
    } else {
    t.siblings("ul")
    .slideDown(300);
    t.addClass("opened")
    }
    return !1
    });

    having said that what is this: e("a.... at the start? where does e come from

    your url isnt working either!

    if you are using jquery you could use toggle()..

IMN logo majestic logo threadwatch logo seochat tools logo