0

I have a problem when I close the Lightbox, because jumps to the top, you can see it in this link http://beautytop.com.br/art-secadores/secadores.php , the problem is with the products at the bottom of the page. I want the page remains in the same place when I close the lightbox.

Here is the code:

$(function() {

    // if the function argument is given to overlay,
    // it is assumed to be the onBeforeLoad event listener
    $("a[rel]").overlay({

        mask: 'black',
        effect: 'apple',

        onBeforeLoad: function() {

            // grab wrapper element inside content 
            var wrap = this.getOverlay().find(".contentWrap");

            // load the page specified in the trigger
            wrap.load(this.getTrigger().attr("href"));

        }

    });
});
Sushil
  • 2,837
  • 4
  • 21
  • 29
  • 1
    Clicking the "X" returns to the top of the page because it links to an anchor: "#". It looks like you'll need to prevent the default action of clicking the `a#close` element. See [preventDefault](http://api.jquery.com/event.preventdefault/) or [return false](http://stackoverflow.com/questions/128923/whats-the-effect-of-adding-return-false-to-an-onclick-event). – showdev May 12 '15 at 16:44
  • possible duplicate of [How can I create an empty HTML anchor so the page doesn't "jump up" when I click it?](http://stackoverflow.com/questions/493175/how-can-i-create-an-empty-html-anchor-so-the-page-doesnt-jump-up-when-i-click) – showdev May 12 '15 at 16:48
  • Thanks for your Answer, I could find the solution, I added return false; I copy & paste the entire code: onClick="$('.close').click(); return false;" – VickyDem May 13 '15 at 17:56

0 Answers0