Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Initialize Sharrre buttons
- function initShare() {
- $('.social-buttons').sharrre({
- share: {
- twitter: true,
- facebook: true,
- googlePlus: true
- },
- template: '<div class="box"><div class="left">Share</div><div class="middle"><a href="#" class="facebook"><i class="icon-facebook"></i></a><a href="#" class="twitter"><i class="icon-twitter-bird"></i></a><a href="#" class="googleplus"><i class="icon-gplus"></i></a></div><div class="right">{total}</div></div>',
- enableHover: false,
- enableTracking: true,
- render: function(api, options){
- $(api.element).on('click', '.twitter', function() {
- api.openPopup('twitter');
- });
- $(api.element).on('click', '.facebook', function() {
- api.openPopup('facebook');
- });
- $(api.element).on('click', '.googleplus', function() {
- api.openPopup('googlePlus');
- });
- }
- });
- }
- // Initialize Magnefic Lightbox
- $('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
- iframe: {
- markup:
- '<div class="mfp-iframe-scaler">'+
- '<div class="mfp-close"></div>'+
- '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
- '</div>'+
- '<div class="after-iframe">'+
- '<div class="details-link"><i class="icon-link"></i> <a class="project-link" href="#">Project Details</a></div>'+
- '<div class="social-buttons" data-url="http://sharrre.com" data-text="Share this" data-title="share"></div>'+
- '</div>'
- },
- delegate: 'a',
- disableOn: 700,
- type: 'iframe',
- mainClass: 'mfp-fade',
- removalDelay: 160,
- preloader: true,
- fixedContentPos: false,
- callbacks: {
- open: function() { // this is dirty, it targets everything at once. Should be refined to use $(this)
- var $target = this.st.el.context.dataset.target;
- $('a.project-link').attr('href', $target);
- $('div.social-buttons').attr('data-url', $target);
- initShare();
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement