Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I try it using my own photos (JPG!) -> I just see white board and score: #28

Open
NoahMakiola opened this issue Mar 7, 2022 · 1 comment

Comments

@NoahMakiola
Copy link

Dear Community,

What do I need to change in the code if I want to use my own photos with jpg?

For example

Instead of:

name: "blank",
img: "images/blank.png"

I renamed it to:

name: "church",
img: "images/church.jpg"

And I did the renaming of all the other parts of the code too.

Appreciate any help <3

@AdemiltonSC
Copy link

Hi,
fire
beer
I changed the img name like you had and add an attribute to the img tag, when it was created in app.js.
The entire function below:

function createBoard(){
for (let i=0; i < cardArray.length; i++){
var card = document.createElement('img');
card.setAttribute('src', 'images/blank.png');
card.setAttribute('data-id', i);
card.setAttribute('style', 'max-height:100px;max-width:100px;');

		card.addEventListener('click', flipCard);

		grid.appendChild(card);
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants