Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6865185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:00:37+00:00 2026-05-27T03:00:37+00:00

This is how I call it document.addEventListener(‘touchmove’, function (e) { e.preventDefault(); }, false); document.addEventListener(‘DOMContentLoaded’,

  • 0

This is how I call it

document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', function () { setTimeout(loaded, 200); }, false);

/**/
$(document).ready(function() {
    //Created an array for adding n iScroll objects
    var myScroll = new Array();

    $('.content').each(function(){
        if($(this).attr('id')==null){
            $(this).attr('id') = $(this).attr('class');
        }
        id = $(this).attr('id');
        console.log(id);
        $(this).html('<div class="scroller">'+$(this).html()+'</div>');
        myScroll.push(new iScroll(id));
    });
});

I modified it a little bit so you can use it with a class and not only id.

It seems to work (to be enabled) because I can drag the container and its content (but it wont keep position, it will restore on mouse release)

If you want to see it happening please visit http://toniweb.us/grano and click on any item in the menu, the new shown has the effect.

Any idea why it is working but not as expected?

The reason I want to do this is because the container has several subcontainers that will be hidden or shown depending on the content selection.

CSS:

#nvl1{
    padding:0px 25px;
    z-index:10;
    position:absolute;
    left:0px;
    background:url("../img/fondoNivel2.jpg") no-repeat scroll right 0 #79797B ; 
    height:100%;
}



#nvl1 .content{
        width:650px;
        z-index:11;
        display:none;
        color:#6666b6b;
        position:relative;
        line-height:30px;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:00:37+00:00Added an answer on May 27, 2026 at 3:00 am

    I had a look at your code on: http://toniweb.us/grano

    I think what you would like to do is use iScroll on your class with “scrolling”. That is not what you are doing in the following code but instead you are actually setting iScroll to use the parent of your scroller DIV:

    id = $(this).attr('id');
    $(this).html('<div class="scroller">'+$(this).html()+'</div>');
    myScroll.push(new iScroll(id));
    

    For reference: iScroll uses an ID rather than a class

    The effect this is having is that it is causing the “snap” effect on the immediately following block level element – your scroller DIV.

    Consider this example where there is a DIV (id=”scroller”) containing an OL which contains a number of (block level) LIs:

    http://cubiq.org/dropbox/iscroll4/examples/simple/

    Long story short, give your DIV with the scroller class an id and create your iScroll from that instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my code: document.addEventListener('mousedown', function (e) { bubbleDOM.style.visibility = 'hidden'; }, false); My
I'm trying to find the jQuery equivalent of this JavaScript method call: document.addEventListener('click', select_element,
function onBodyLoad() { document.addEventListener(deviceready,onDeviceReady,false); //for testing in safari only, comment out for deploy to
I have a jQuery plugin tzineClock. But when I try to call it $(document).ready(function(){
I have a problem open: function($type) { //Some code document.getElementById($type).addEventListener(click, l.close($type), false); }, close:
There is a table in a databse, let's call this table Document. This table
I have identified this call as a bottleneck in a high pressure function. graphics.DrawImage(smallBitmap,
I've got an html page from where Im making this call periodically: function logon(id)
i've learned that you can register body onload like this: window.addEventListener('load', function, capture); //
I have this method call I have to use... financial_document.assets.length But financial_document.assets could be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.