Different function test result inquiry
These four functions are doing different things:

The 1st and 4th set up immediately and down when the user scrolls.

The 2nd and 3rd set both up and down when the user scrolls. (The 2nd seems unlikely to work properly because triga is not defined in the 1st function, so the line triga.css("display", "none"); will result in an error. Only in the 1st will the triga element be initially hidden.)

So they will behave differently if the element #horiz_line changes position between the function being set and the user scrolling.

I'm guessing what you want is to check the position of the horizontal line and the scroll top when the user scrolls. In this case something like the 2nd and 3rd function should work, but it is needlessly complicated to pass the values as parameters and call a function from within a function. Instead you can do either:

$(function() {
  var triga = $('.trigger');
  triga.css("display", "none");
  $(window).scroll(function() {
    var down = $(this).scrollTop(),
        up = $('#horiz_line').offset().top + $('#horiz_line').height() + 25;
    triga[down &gt; up ? 'fadeIn' : 'fadeOut']('fast');
  });
});


or

$(function() {
  var triga = $('.trigger');
  triga.css("display", "none");
  $(window).scroll(scrollMenu);
  function scrollMenu() {
    var down = $(window).scrollTop(),
        up = $('#horiz_line').offset().top + $('#horiz_line').height() + 25;
    triga[down &gt; up ? 'fadeIn' : 'fadeOut']('fast');
  }
});


If, on the other hand, up never changes, then there will be a performance advantage to either defining up as a global variable or passing it as a parameter to the scrolling function (because accessing the DOM is usually costly in terms of performance.)

I think the other aspect of your question is whether there is a performance difference in passing a value as a parameter to a function vs. having it in the scope of an outer function; I don't know but suspect it makes a negligible difference, especially if the parameter is first defined as a variable in the outer function anyway.

More generally: focus on understanding how the code works before worrying about performance optimisation!