robertpateii / jQuery-Timelinr-app

A node application for hosting the Timelinr plugin on a webpage and adding images to it.
0 stars 0 forks source link

Timelinr Issue Please Help!! #1

Open advance339 opened 11 years ago

advance339 commented 11 years ago

Hello Robert,

My name is Daniel and I decided to use this jQuery plugin for my class project. I'm not an advanced developer at all and I need to know how to create multiple timelines in my project. For an example here is the website: http://das0311.aisites.com/hivaids/ Can you please help me

robertpateii commented 11 years ago

Hi Daniel,

It looks like you have the same ID on the page multiple times. That will generally break things as IDs should only occur once on a page.

Since my repo is just about building a node app around the Timelinr plugin, you first should read over the core project's readme and then read my suggestions below.

It doesn't look like the original author expected multiple Timelinrs to be used on a single page, however he did provide for setting a lot of parameters. You could try making all the IDs unique to each instance of the Timelinr, and then initializing multiple Timelinrs with custom parameters for each.

For instance, you'd change things like this: id="timeline" to id="timelineMark" $().timelinr() to $().timelinr({containerDiv: '#timelineMark'});

You'd have to apply similar treatment to all the other import IDs.

Hope that helps.

Rob

advance339 commented 11 years ago

Im still a little confused can you explain that again?

robertpateii commented 11 years ago

It's hard to re-explain something unless I know what specifically you didn't understand. You'll have to be more specific in your question.

Also, your teacher or TA will probably be better able to explain than I would. Have you asked them for help? Have you read the readme I linked on the real Timelinr project? Do you understand how IDs work?

Here's the documentation on how IDs work: https://developer.mozilla.org/en-US/docs/Web/API/element.id

advance339 commented 11 years ago

Okay I apologize. I dont understand where to put the function in the html document. How do you call multiple functions at once with all separate id names. This is what I did: screen shot 2013-06-03 at 8 13 22 pm

I also made two seperate Js scripts screen shot 2013-06-03 at 8 16 12 pm screen shot 2013-06-03 at 8 16 18 pm

robertpateii commented 11 years ago

you know, the easiest way to do this is to make 3 separate pages. Even with a deeper understanding of javascript, it probably isn't worth the time to configure it for multiple pages. You can use the same script, the same IDs, all that, just put them on different pages named after each person.

it's also fine semantically. each person should have a unique link anyway.

good luck, Robert

advance339 commented 11 years ago

Thanks Robert!