Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6225281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:48:55+00:00 2026-05-24T08:48:55+00:00

Probably this is a basic stuff, but better learn now then later. What i’m

  • 0

Probably this is a basic stuff, but better learn now then later.

What i’m doing :
I ‘m implementing a gallery that is getting a xml, and then build me using some javascript code. the problem i tried to call twice gallery.init like :

$(document).ready(function(){


    galleryXML.init({
        xmlPath : "data/gallery.xml",
        imgPath : "images",
        perView : 4,
        id: "#gallery1"
    });
    galleryXML.init({
        xmlPath : "data/gallery.xml",
        imgPath : "images",
        perView : 4,
        id: "#gallery"
    }); 
})

I expected to have one in #gallery1 other in #gallery. Can someone tell me what the problem?

The rest of the code is here only need to download, unrar and execute the index.html (Working just in firefox, not sure why too)

Thanks in advance.

UPDATE

This is a minimal example for now, not sure if represent well the problem.

http://jsfiddle.net/PSYCKIC/rpNab/2/ -> UPDATED

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:48:56+00:00Added an answer on May 24, 2026 at 8:48 am

    I think your problem can be that you are using the same variable _P for (what you expect to be) 2 different instances of the galleryXML.

    The _P variable is created and initialized when the javascript code is parsed, because of the () after the var galleryXML = function() {...}.

    So I guess your problem is going to be solved if you just put the variable inside the init of galleryXML. You can see the code here: jsfiddle.net/rpNab/3/ (notice that now each li is inside each gallery, instead of both li in the last gallery)

    EDIT: And I realize that now with my modification the galleryXML module seems ugly (because it only has one method and no variables), so I made a minor refactoring in order to have more methods inside that class, but the methods now must receive the parameter because the class itself continue to be “static”, but the parameters can make it act for different contexts. Hope it helps: jsfiddle.net/rpNab/4/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a noob so this is probably basic stuff, but I have tried to
This is probably very basic stuff, but please bear in mind I am completely
This is probably a silly question, but curiosity has gotten the better of me.
This is probably basic but I really tried to find the answer. C-k deletes
This is probably a basic question for some, but it affects how I design
This is probably very basic, but it's giving me a headache, and I'm not
This is probably basic stuff, so if there's some kind of online reference for
This probably has a simple answer, but I must not have had enough coffee
This probably sounds really stupid but I have noo idea how to implement jquery's
I could probably write this myself, but the specific way I'm trying to accomplish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.