Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freewall with Easy Tabs #239

Open
vancesp opened this issue Feb 13, 2017 · 0 comments
Open

Freewall with Easy Tabs #239

vancesp opened this issue Feb 13, 2017 · 0 comments

Comments

@vancesp
Copy link

vancesp commented Feb 13, 2017

I'm wondering how I can make Freewall work with Easy Tabs flawlessly. I've tried binding the freewall function with 'easytabs:after' event and was able to call on the freewall function on my other tab but it always initiates when switching tab and it looks messy. Is there anyway to make this work flawlessly with or without animation and to make it not re-arrange everytime I switch tab?

Here's my code:

<script>
  $('#tab-container').easytabs({
    defaultTab : 'li.defaultactive',
    updateHash: false,
    animate: false
  });
  
$(document).ready(function() {
  $(".free-wall").each(function() {
    var wall = new freewall(this);
    wall.reset({
      selector: '.homeblock',
      fixSize: 0,
      gutterY: 10,
      gutterX: 10,
      cellH: 'auto',
      animate : true,
      delay: 1,
      onResize: function() {
        wall.fitWidth();
      }
    })
    wall.fitWidth();
  });
  $(window).trigger("resize");
});
  
$('#tab-container')
  .on('easytabs:after', function() {
    $(".free-wall").one(function() {
    var wall = new freewall(this);
    wall.reset({
      selector: '.homeblock',
      fixSize: 0,
      gutterY: 10,
      gutterX: 10,
      cellH: 'auto',
      animate : true,
      delay: 1,
      onResize: function() {
        wall.fitWidth();
      }
    })
    wall.fitWidth();
  });
  $(window).trigger("resize");
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant