Question: I'm using colorbox and wanted to know if you know any way to display the popup when the visitor is scrolling the site.

I know it's possible to display the popup when the page loads and to display the popup after X seconds. But that does not help me.

I saw some websites that display the popup when the visitor scrolls down the page.

How to do it?

Answer: 
You may need to specify the active profiles through System Properties:

```
-Dspring.profiles.active="integration"

```

in case you want to use the related bean implementation or

```
-Dspring.profiles.active="one-off-test"

```

to use the *one-off-test* profile beans.

Then you will have to set the `inheritProfiles` annotation propertyto `false` which will prevent the current annotated test case to discart subclass profiles:

```
@ActiveProfiles(profiles = {"one-off-test"}, inheritProfiles= false)
public class MyTest extends TestBase {}

```
One solution to the problem you presented is to use `primary` like this:

```
<beans profile="integration">
    <bean class="org.easymock.EasyMock" factory-method="createMock" primary=true>
        <constructor-arg value="com.mycompany.MyInterface" />
    </bean>
</beans>

```

You don't need to change anything else because Spring will use the bean from profile `integration` wherever a bean of type `MyInterface`. Spring does that despite the fact that there are multiple beans of that type present.

Check out [this](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/context/annotation/Primary.html) which gives a few more details on how `primary` works.