facebook

Jump to element

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #343099 Reply

    Muhammad
    Member

    my project’s name is index4, panel id is panel1, and I want to scroll to element that has value as jump_to,
    is it corrent using this code?

    $('#m1-index4-panel1-scroller').scrollToElement('#' + jump_to,'1s');

    I tried to use this code but nothing happend.

    Any tips and advice appreciated.

    #343112

    Hi Muhammad,

    Have you taken a look at this example? It might be helpful for you:
    http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=3818

    #343116

    Muhammad
    Member

    I read your link, but that is for jump to x and y value.
    Do you have solution for jump base on element?

    Thank you.

    #343162

    Hi Muhammad,

    I have been doing a couple of tests but didn’t have success. I asked assistance from dev team to learn if/how this is possible.

    #343182

    support-michael
    Keymaster

    >I read your link, but that is for jump to x and y value. Do you have solution for jump base on element?

    If you can access the element then you can get its coordinates, right? Did you try that approach?

    #343198

    Muhammad
    Member

    Thank you so much for your advice. Its solve it!.

    This is code to get x and y position value. I hope will helpfull for others.

     function getOffset( el ) {
            var _x = 0;
            var _y = 0;
            while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
                _x += el.offsetLeft - el.scrollLeft;
                _y += el.offsetTop - el.scrollTop;
                el = el.offsetParent;
            }
            return { top: _y, left: _x };
        }
    #343203

    support-michael
    Keymaster

    @Muhammad

    I finally got a few mins to research this a bit more as I’m rusty on my iscroll api knowledge. See the following iscroll4 function:

    scrollToElement(element, time)

    There are additional iscroll api available for your use. See the javascript api for iscroll4: http://cubiq.org/iscroll-4 scroll down to “JavaScript Scrolling” section.

    #343205

    Muhammad
    Member

    Thank you for your follow up.

    I used scrollToElement function but I dont know how to point to panel.
    Do you know how to scroll to element for one panel? For example how to scroll for panel that has name panel1 ?

    scrollToElement(element, time) 

    Thank you.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Jump to element

You must be logged in to post in the forum log in