How to set up the browser scrollbar to scroll part of a page?

Question!

I've seen this done in a few sites, an example is artofadambetts.com. The scroll bar on the page scrolls only an element of the page, not the entire page. I looked at the source and havent't been able to figure it out yet. How is this done?

By : airportyh


Answers

For a div, you can add in the cSS

overflow: auto

For example,

<div style="overflow:auto; height: 500px">Some really long text</div>

Edit: After looking at the site you posted, you probably don't want this. What he does in his website is make the layout as fixed (position: fixed) and assigns it a higher z-index than the text, which is lower z-index.

For example:

<div class="highz"> //Put random stuff here. it'll be fixed </div>
<div class="lowz"> Put stuff here you want to scroll and position it.</div>

with css file

div.highz {position: fixed; z-index: 2;}
div.lowz {position: fixed; z-index: 1;}
By : apandit


Try this for scrolling a particular part of web page......

 <html>
      <head>
      <title>Separately Scrolled Area Demo</title>
        </head>
          <body>
              <div style="width: 100px; border-style: solid">

            <div style="overflow: auto; width: 100px; height: 100px">
                        sumit..................
                        amit...................
                        mrinal.................
                        nitesh................
                        maneesh................
                        raghav...................
                        hitesh...................
                        deshpande................
                        sidarth....................
                        mayank.....................
                        santanu....................
                        sahil......................
                        malhan.....................
                        rajib.....................
                         </div>
                      </div>
                  </body>
      </html>


Searching for change MATLAB shortcuts here on StackOverflow yields some results.

I know VS and Eclipse well and IMO MATLAB IDE does its job pretty good. It is the only one with:

  • reasonably auto-complete because it knows which functions are in the MATLAB path.
  • debugger and command window.
  • easy input -> easy output, like a scientific pocket calculator running on PC

With MATLAB (or say Python) the approach to coding is different then with VS or Eclipse for say C++ or Java. For example - with command window in MATLAB IDE you can evaluate almost everything. Together with debugger you can write new code pieces and evaluate them in succession, it's like exploring.

Being a dynamic language you also can not expect mach refactoring. So from a practical viewpoint it makes sense that MATLAB IDE is the way it is. Also the problems solved with MATLAB are different from these were Java is used.

By : Mikhail


This video can help you solving your question :)
By: admin