Hey Guys,
i have a little problem. I tryed to make a Website with AngularJS.
I have a few Subpages and changed the content with Angular JS Routing.
That works fine but i also used a parallax Scolling Plugin from JQuery. And when i changed the content only the Text changes, the parallax Images changes only after a reload.
I have to make it this way, because it is a excercise from school i have to solve.
index.html
...
<div id="content">
<div ng-view></div>
</div>
...
home.html
...
<div id="about" class="img-holder" data-image="images/about.jpg" data-width="1680" data-height="945">
<div class="header_parallax">
<p>About</p><br/>
<p>...</p><br/>
<p>...</p><br/>
</div>
</div>
<section class="home_cont">
...
</section>
...
contact.html
...
<div id="contact" class="img-holder" data-image="images/contact.jpg" data-width="1680" data-height="945">
<div class="header_parallax">
<p>Contact</p><br/>
<p>...</p><br/>
<p>...</p><br/>
</div>
</div>
<section class="home_cont">
...
</section>
...
routing.js
app.config(function($routeProvider) {
$routeProvider
.when('/home', {
templateUrl : 'templates/home.html',
controller : 'homeController'
})
.when('/contact', {
templateUrl : 'templates/contact.html',
controller : 'contactController'
})
.otherwise({redirectTo: '/home'});
});
So you can see, i have a home and a contact site. If on a button, i load the other content. That works, but the Image only changes after a refresh of the whole site.
Is there a way to refresh the Site after a click (onCLick in the Navi dosn't work, because it refreshes before the new content is initialised.
Or is there a better way to do this? It is important, that it is a one-pager.
Greez