Question: I have the following HTML with CSS `.container { overflow: scroll; }` etc.

```
<body>
<div class="container">
  <div id="markers"></div>
  <img id="map" src="/img/map.jpg"/>
</div>
</body>

```

`map.jpg` is very large and I want to scroll to a fixed position like this:

```
$(function(){
  console.log($('.container').scrollTop());
  $('.container').scrollTop(1000);
  console.log($('.container').scrollTop());
  console.log($('.container').scrollLeft());
  $('.container').scrollLeft(1750);
  console.log($('.container').scrollLeft());
});

```

`scrollLeft` works fine but `scrollTop` doesn't. Below is the console output.

```
0
0
0
1750

```

I've been searching for half an hour but still don't know how to fix it...

---

**UPDATE:** CSS about `.container` `#markers` and `#map`

```
.container { overflow: scroll; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; }
#map { width: 5000px; max-width: 5000px; height: 2907px; max-height: 2907px; cursor: crosshair; }
#markers { position: relative; top: 0; left: 0; width: 0; height: 0; margin: 0; padding: 0; }

```

Answer: 
When you want to do something like this, you should know ahead of time which properties you want available to your super class. You would declare them as protected in your base class so that your subclasses can set them according to their own rules. 

You cannot, as previously said, access a child's newly-declared property (like `_def2` and `_def` in class `Def`) from the base class.

If you instantiate a child type and assign it to a super type, like `Abc ab = new Def()`, you are deciding to treat `ab` as an `Abc`, meaning, you are letting go of `Def`'s specific members and functions when you do stuff to `ab`. It is true that `ab` is truly a `Def`, BUT you must manipulate it as an `Abc`.

Similarly, if you pass a `Def` in a function `someFunction(Abc ab)`, that function better treat `ab` as an `Abc`. `someFunction(Abc ab)` is created to process whatever child types of `Abc` could be, but only by their common properties and methods as defined in `Abc`.
Members of a child class can not be accessed from a base class since it does not know which class has inherited it. The only way to reach to child class members would be achieved by polymorphism and by downcasting.

```
    class Base{
        public Base();
        int a;
    }

    class Derived : Base{
        public Derived();
        public int b;
    }
    Base testBase = new Test;
    Base testDerived = new Derived;
    testBase.a = (Derived)testDerived.b; // Downcasting here.

```