Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ======================================================================== */
- /* 55. SliderLetters */
- /* ======================================================================== */
- var SliderLetters = function ($scope) {
- var
- $SVGLetters = $('.vector-letters'),
- $letters = $SVGLetters.find('.vector-letter'),
- $menuItems = $scope.find('.menu-overlay a'),
- tl = new TimelineMax();
- if (!$SVGLetters.length || !$letters.length) {
- return;
- }
- /** insert this **/
- /////////////////////////////////////////////
- TweenMax.set($letters[0], {
- morphSVG: $letters.filter('#vector-X') // modify to the letter as you need: #vector-B, #vector-H, etc
- });
- /////////////////////////////////////////////
- hoverMenuitems();
- function hoverMenuitems() {
- $menuItems.each(function () {
- var
- $current = $(this),
- currentLetter = $current.data('letter'),
- targetLetter = $letters.filter('#vector-' + currentLetter);
- $current
- .on('mouseenter touchstart', function () {
- tl
- .clear()
- .to($letters[0], 0.6, {
- morphSVG: targetLetter,
- ease: Expo.easeInOut
- });
- });
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement