All Projects | Skillshare Projects

21

8

All Projects

I wasn't sure where to post my other projects so I'm just adding it to this. Hope you see it.

Anyways, this was difficult for me. I was actually able to get the modal to open pretty quickly first I had the onclick in the HTML file, but found I can onclick in javascript so changed it. Also creating the cancel button and getting it to work was fairly easy as well.

What I struggled with was the X button. Through googling I found you put a [0] at the end, and that worked, but I'm not sure why.

Also I could not figure out how to close the modal by clicking outside of it.  I found and tried this code

window.onclick = function(event) {
 if (event.target == modal) {
     modal.style.display = "none";
}

 

What it did was if I selected text in the modal and dragged it to off the modal to the screen it would close, but by just clicking it didn't work.  If that makes sense. I left it in so you could see.

I also am not happy with the placement. when the modal is in codepen you can not see the bottom unless you expand the area.

I've literally been working on this for hours so I figured I would post what I have and see what you had to say.

 

 

 

 

 

 

I was having problem with the submit. Whenever I pressed submit the page would reload or in codepen it would give me a Bad Path /boomboom/index.html.

So I google that and found an answer saying to change the button to input instead and when I did that ta-da it worked.

But I could not get it to work in the button format with my javascript code. After watching the video maybe using the .options with the [select.selectIndex] would have fixed that. I'm not sure yet.

Comments

Please sign in or sign up to comment.