# Javascript only on Product page.

**URL:** <https://forum.shopware.com/t/javascript-only-on-product-page/32907>\
**Category:** International (English Only)\
**Tags:** themes--design\
**Created:** [9. Dezember 2015 um 20:32 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907 "2015-12-09T20:32:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![U365](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@U365](https://forum.shopware.com/u/U365)\
**Post date:** [9. Dezember 2015 um 20:32 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/1 "2015-12-09T20:32:33Z")

</div>

Hello community, :shopware: im trying to figure out how to add javascript “scrollintoview()” only into Product page. looking for advice, Best regards :thumbup: 😉

---

<div class="post-metadata">

**Author:** ![U365](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@U365](https://forum.shopware.com/u/U365)\
**Post date:** [10. Dezember 2015 um 21:39 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/2 "2015-12-10T21:39:30Z")

</div>

bump up

---

<div class="post-metadata">

**Author:** ![U365](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@U365](https://forum.shopware.com/u/U365)\
**Post date:** [11. Dezember 2015 um 17:26 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/3 "2015-12-11T17:26:07Z")

</div>

The topic is still open :x Bets regards :thumbup:

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [11. Dezember 2015 um 17:29 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/4 "2015-12-11T17:29:41Z")

</div>

Im afraid nobody knows what you actually want to do. What exactly is scrollintoview()?! Is this your own custom javascript method?! Is it a jquery plugin? Kind regards

---

<div class="post-metadata">

**Author:** ![U365](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@U365](https://forum.shopware.com/u/U365)\
**Post date:** [11. Dezember 2015 um 17:39 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/5 "2015-12-11T17:39:08Z")

</div>

Oh that could be one of the possibilities. Ok so i want to add javascript only into Product view page, so when someones get rediricted to product page the script would scroll the page view exactly at the point i want, for example skipping the header and going direkt to page-wrapper. 🙂 the idea came because i use little big header, so costumers need to scroll first to view product (and i find it little frustrating) 😃 More about that script. [https://developer.mozilla.org/en-US/doc … llIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView) PS. Pretty sure its jquery Best regards :thumbup:

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [11. Dezember 2015 um 17:49 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/6 "2015-12-11T17:49:45Z")

</div>

yeah its a DOM Method - But you have this in your own js script correct? So you would add this js to the index.tpl in your detail view e.g frontend/detail/index.tpl `{extends file="parent:frontend/detail/index.tpl} {block name="frontend\_index\_header\_javascript\_jquery\_lib" append} YOUR JS {/block} ` You may also use smarty literal function for your js: [http://www.smarty.net/docsv2/en/languag … iteral.tpl](http://www.smarty.net/docsv2/en/language.function.literal.tpl)

---

<div class="post-metadata">

**Author:** ![U365](https://avatars.discourse-cdn.com/v4/letter/u/f1d935/32.png) [@U365](https://forum.shopware.com/u/U365)\
**Post date:** [11. Dezember 2015 um 18:01 UTC](https://forum.shopware.com/t/javascript-only-on-product-page/32907/7 "2015-12-11T18:01:17Z")

</div>

Ye, i was looking for the folder where i needed to attach the script. So its details :oops: Thank you sir :thumbup: Problem solved, Best regards :thumbup:
