I had a similar issue with an anchor link inside a core-header-panel going
to an id in a core-scroll-header-panel, and was lucky to get a fix from
Frankie Fu in this post
<https://groups.google.com/forum/#!topic/polymer-dev/4U5NHNvnUzs>.
I just needed to add this function:
scrollToTopic: function(e) { var id = e.target.getAttribute('name'
); if (id) {
this.$.core_scroll_header_panel.scroller.scrollTop
= this.$[id].offsetTop - 75; } }
and give my core-item the corresponding name (skills in your case). Maybe
that works or you can adapt it, if your element is not inside a
core-scroll-header-panel.
Lex
Am Mittwoch, 12. November 2014 04:30:28 UTC+1 schrieb Gee Jay Almestas:
>
> im using *core-scaffold* and *core-item* for my menu i also have *my own
> element wrapped by a div id* i want my core-item menu to scroll to that
> div when i click it... what will i do to do it? tried to use jquery but its
> not working... see info below
>
> *here's my header panel*
> <core-scaffold responsiveWidth="600px">
> <core-header-panel navigation flex mode="scroll">
> <core-toolbar>Navigation</core-toolbar>
> <core-menu theme="core-light-theme">
> <core-item icon="home" label="Home"></core-item>
> <core-item icon="assignment-ind" label="Who am i"></core-item>
> <core-item icon="work" label="Works"></core-item>
> *<core-item icon="work" label="Skills"><a class="nav"
> href="#skill"></a></core-item*> *<!-- WHEN CLICK WILL GO TO SKILL ID DIV
> -->*
> <core-item icon="settings-phone" label="Contacts"></core-item>
> <core-item icon="link" label="v8"></core-item>
> <core-item icon="link" label="v7"></core-item>
> <core-item icon="link" label="v6"></core-item>
> </core-menu>
> </core-header-panel>
>
> *my element*
>
>
>
> *<div id="skills"> <!-- should scroll on this part -->
> <skills-koh></skills-koh> <!-- my element --></div></core-scaffold>im
> trying to use a js script but its not working*
>
>
> *jQuery(".nav").on("click", function(event){ event.preventDefault();
> var dest=null; if(($($(this.hash)).offset().top) >
> ($(document).height()-$(window).height())){ dest=
> $(document).height()-$(window).height(); }else{
> dest=$($(this.hash)).offset().top; }
> $($(this.hash)).trigger("click");
> $('html,body').animate({scrollTop:dest}, 500, 'swing' ); });*
>
>
> *also added on my index.html<script
> src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
> <http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js>"></script>*
>
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/b009187a-7db3-4e7d-9e98-0b0458dcfd4e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.