# Offset für plugin/swScrollAnimate/scrollToElement

**URL:** <https://forum.shopware.com/t/offset-fur-plugin-swscrollanimate-scrolltoelement/38697>\
**Category:** Programmierung\
**Created:** [2. August 2016 um 05:33 UTC](https://forum.shopware.com/t/offset-fur-plugin-swscrollanimate-scrolltoelement/38697 "2016-08-02T05:33:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hbee](https://avatars.discourse-cdn.com/v4/letter/h/f08c70/32.png) [@hbee](https://forum.shopware.com/u/hbee)\
**Post date:** [2. August 2016 um 05:33 UTC](https://forum.shopware.com/t/offset-fur-plugin-swscrollanimate-scrolltoelement/38697/1 "2016-08-02T05:33:45Z")

</div>

hi, ich habe in meinem Theme eine Sticky-Navigation. die ist im Grunde mit position:fixed unf top:0 &nbsp;oben angepinnt. Wenn ich jetzt zb. auf der Detailseite auf Bewerten klicke, werden die Tabs logischerweise von der Navigation verdeckt. jetzt habe ich gesehen, dass man der Funktion&nbsp;plugin/swScrollAnimate/scrollToElement ein Offset mitgeben kann.

```
/**
         * Scrolls the target element to the vertical position of another element.
         *
         * @public
         * @method scrollToElement
         * @param {jQuery} $targetEl
         * @param {Number} offset
         */
        scrollToElement: function ($targetEl, offset) {
            var me = this;

            if (!$targetEl.length) {
                return;
            }

            $.publish('plugin/swScrollAnimate/onScrollToElement', [me, $targetEl, offset]);

            me.scrollToPosition($targetEl.offset().top + ~~(offset));
        },

```

&nbsp;Wie und wo stelle ich das an?

ich habe versucht mit darauf zu registrieren:

```
 $.subscribe('plugin/swScrollAnimate/scrollToElement', function(plugin) {

            console.log('scroll');
        });

```

passiert aber nix – keine Ausgabe.&nbsp;

Die Frage ist nun, wie kann ich hier ein Offset mitgeben damit die Tabs nicht mehr verdeckt werden?

Vielen Dank
