Jump to content

Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Community Reputation

8 Newbie

About DD77

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. any reaso why the TweenMax.to(window, 1, { scrollTop: theOffset.top - 56 }); isn't working now?
  2. Hi YA, I'm having so difficulties to make this functionality to work smoother and better. I need auto hight as my content is quite dynamic. When I click the height of the accordion fires but doesn't have and smoothens on the animation. What am I missing? Also is it done all ok overall? Would you change anything in there? Thanks, D $(".accordion-item .button").click(playAnimation); function playAnimation(event) { event.preventDefault(); var $this = $(this).parent(); var $thisContent = $this.find('.accordion-content .article'); TweenLite.to($this,.3, {className: '-=expanded'}); TweenMax.to($thisContent, .3, {autoAlpha:0,ease: Sine.easeInOut, onComplete:function() { TweenMax.to($('.accordion-content .article'), .3, {height: "0",ease: Sine.easeInOut}) } }) if (!$this.hasClass('expanded')){ var self = this; setTimeout(function() { theOffset = $(self).offset(); $('body,html').animate({ scrollTop: theOffset.top - 56 }); }, 310); TweenMax.to($(".accordion-item"), .3, {className: '-=expanded', ease: Sine.easeInOut}) TweenMax.to($this, .3, {className: '+=expanded', ease: Sine.easeInOut}) TweenMax.to($('.accordion-content .article'), .3, {height: "0",autoAlpha:0, ease: Sine.easeInOut}) TweenMax.to($thisContent, .3, {height: "auto", ease: Sine.easeInOut, onComplete:function() { TweenMax.to($('.accordion-content .article'), .3, {autoAlpha:1,ease: Sine.easeInOut}) } }) } }
  3. @mikel Sure, what's on line 26? is commented off!
  4. Ok, managed to do it. what do you think? https://codepen.io/davide77/pen/PMNaJg?editors=0010
  5. @mikel thank to you. Please Mikel, would you be able to direct me on how to tooggle the parent "accordion-group"? so I can close and open it?
  6. @Mikel thanks, really helpful, this helped me a lot. I'm not manages to: - add class to parent "expanded" -add function that move to top of the list the clicked element. todo: make it better, smother and perhaps without a feeling that the clicked one jumps to the top. @mikel what do you think? https://codepen.io/davide77/pen/oKxpJw
  7. @ZachSaucier I think i could achieve it with my setup. would you be able to help?
  8. @Jonathan I managed to achieve what I need it. I'm still have to some one important part of this task. Basically, on click, the clicked element should move to the top, so like this the user could always scroll down to click the others. onComplete: function() { if ($(element).length){ $("#menu").prepend($(element)) } } this code moves the element to the top. Now I need a tell the others to re-order the height and the top position. Could anyone help me please? https://codepen.io/davide77/pen/aevWYQ
  9. Yes I changed it, accordion-menu
  10. @Jonathan trust me I checked, but I did some copy and paste to mate demos. https://codepen.io/davide77/pen/qeBJxO?editors=1010 even with the right class. Can't figure it out!!
  11. I'm actually using a code from Blake! which is perfect. Unfortunately I keep getting error: Uncaught Cannot tween a null target. I'm trying, I've also tried your code. :-( https://codepen.io/davide77/pen/qeBJxO?editors=1010
  12. @ZachSaucier and thanks for that, but you not targeting the .accordion-group, also the toggle doesn't work, it should close the other Have a look at this please https://codepen.io/davide77/pen/RXwYrO?editors=0010
  13. @PointC thanks, really helpful
  14. @ZachSaucier Pease have a look at this, I'm quite close, only thing is now adding the extended class to all of them. It should add the class only to the clicked one https://codepen.io/davide77/pen/rEojde?editors=1010