JavaScript Aftershow in fancybox jQuery

I had the same problem this person: ShareThis plugin not working in FancyBox title But now I have gotten it work, except the

afterShow: function(){
 stButtons.locateElements();
}

Where in this code should I put it? I've tried many places, but it just says error. It say's I am placing it wrong. Where should I place it in the script below?

<script type="text/javascript">



$(document).ready(function(){
    $(".fancybox").fancybox({


             beforeShow: function() {
 var caption =  $(this.element).data("caption") ? $(this.element).data("caption") : "";
 this.title = this.title ? this.title + buildShareThis(this.href) + caption : buildShareThis(this.href) + caption;



        if (this.title) { ''

        // New line
            this.title += '<br />';



        }
    },




        nextEffect  : 'fade',
prevEffect  : 'fade',
padding     : 0,
margin      : [15, 15, 50, 15],
afterLoad   : addLinks,
beforeClose : removeLinks

        });


      function buildShareThis(url){
var customShareThis  = "<div class='share'>"; // class for styling maybe
 customShareThis += "<span class='st_facebook_hcount' displayText='Facebook' st_url='"+url+"'></span> ";
 customShareThis += "<span class='st_twitter_hcount' displayText='Tweet' st_url='"+url+"'></span>";
 customShareThis += "<span class='st_pinterest_hcount' displayText='Pinterest' st_url='"+url+"' st_img='"+url+"' ></span>";
 customShareThis += "<span class='st_tumblr_hcount' displayText='Tumblr' st_url='"+url+"'></span>";
 customShareThis += "</div>";
 return customShareThis;
}

    function addLinks() {
var list = $("#links");

if (!list.length) {    
    list = $('<ul id="links">');

    for (var i = 0; i < this.group.length; i++) {
        $('<li data-index="' + i + '"><label></label></li>').click(function() {     $.fancybox.jumpto( $(this).data('index'));}).appendTo( list );
    }

    list.appendTo( 'body' );
 }

list.find('li').removeClass('active').eq( this.index ).addClass('active');
}

function removeLinks() {
$("#links").remove();    
}

});

</script>
Answer:1

I'm trying to group with kendo grid, but I am facing a problem with the default functionality of kendo grouping. Kendo grid groups the columns but it doesn't differ records of "USA" with "usa", these ...

I'm trying to group with kendo grid, but I am facing a problem with the default functionality of kendo grouping. Kendo grid groups the columns but it doesn't differ records of "USA" with "usa", these ...

  1. kendo grid grouping angular
  2. kendo grid grouping mvc
  3. kendo grid grouping collapse all
  4. kendo grid grouping jquery
  5. kendo grid grouping demo
  6. kendo grid grouping example
  7. kendo grid grouping and paging
  8. kendo grid grouping header template
  9. kendo grid grouping server side
  10. kendo grid grouping sort order
  11. kendo grid grouping
  12. kendo grid grouping template
  13. kendo grid grouping not working
  14. kendo grid grouping aggregate
  15. kendo grid grouping row template
  16. kendo grid grouping event
  17. kendo grid grouping header
  18. kendo grid grouping order
  19. kendo grid grouping asp.net mvc
  20. kendo grid grouping sort

I have always seen code like this: (function(){ //code here })(); How does this code work? Which function receives which parameters? (function(factory){ //code here }(function($){ //other ...

I have always seen code like this: (function(){ //code here })(); How does this code work? Which function receives which parameters? (function(factory){ //code here }(function($){ //other ...

I guess the better question here is more general: how do I debug errors for deployed apps? Does Meteor have commands/logs I can look at? I'm really not sure where to begin because everything works ...

I guess the better question here is more general: how do I debug errors for deployed apps? Does Meteor have commands/logs I can look at? I'm really not sure where to begin because everything works ...

  1. exception in defer callback
  2. deferred exception callback

i am working on codeigniter. I want to display data from backend to the view files. here is my code $result = $obj->get_details(); if ($result[0]) { for ($i=0; $i<count($result)...

i am working on codeigniter. I want to display data from backend to the view files. here is my code $result = $obj->get_details(); if ($result[0]) { for ($i=0; $i<count($result)...