user1165861
user1165861

Reputation: 857

Dynamic Page Loader Conflict

I have a dynamic page changer that I found and used on my site. I don't want to get rid of it but it seems to be causing a few problems. When an .html file is called it is called like news.html#news.html for example, in order to work. For example when the about page is clicked it is about.html#about.html in the url and if i click the news page right after it becomes about.html#news.html becasue the dynamicpage.js combines them all somehow. I managed to load most of the pages except the gallery page. It doesn't seem to load the way its supposed to unless you change gallery.html#gallery.html in the url to just gallery.html

The site is still under construction but here it is: http://envycosmetics.zxq.net/Website/webpages/index.html

Upvotes: 0

Views: 154

Answers (1)

VictorKilo
VictorKilo

Reputation: 1870

Now that your site is a little further along I can see what's going on a little better. It looks to me like the jQuery is not being called again when the gallery page is "loaded" since the page has technically already been loaded once. What you need to do is add something like this to your page:

$(document).ready(function(){
  $("#gallery").click(function(){
    Galleria.loadTheme('galleria.classic.min.js');

    // Initialize Galleria
    $('#galleria').load(function(){
        $('#galleria').galleria();
    });
  });
});

I just tried that on your site using the chrome console and it worked. One thing that might snag you is that you will need to wait for $("#gallery") to be ready before you should reinitialize galleria. It worked with the console, but it may not work if you have it within your page.

Another note, you should add the height element to your galleria call. It tends to be a stickler for that:

$('#galleria').galleria({
    width:500,
    height:500
});

Upvotes: 1

Related Questions