Skip to content

Project-JS - Mihaela#6

Open
hmihaella wants to merge 20 commits into
ITSchool-Web-Heroines:mainfrom
hmihaella:main
Open

Project-JS - Mihaela#6
hmihaella wants to merge 20 commits into
ITSchool-Web-Heroines:mainfrom
hmihaella:main

Conversation

@hmihaella

@hmihaella hmihaella commented Sep 14, 2022

Copy link
Copy Markdown

Am incercat sa adaug si un loading page, dar indiferent de ce am testat, nu mi-a iesit nicicum...
Una dintre variantele folosite a fost urmatoarea:

am adaugat un div pentru pagina de preload cu div id = preload
in css am facut:

#preload {
background: white url(./preview.gif) no-repeat center center;
height: 100vh;
width: 100%;
z-index: 100;
position: fixed;
}

iar in js:
var loader = document.getElementById("preload");

  window.addEventListener("load", function(){
  loader.style.display - "none";
})

am incercat si alte variante, urmarind pas cu pas pe youtube, dar niciuna nu mi-a iesit
https://codesandbox.io/s/nifty-dan-jv9u1s
asta e alta varianta, care nu mi-a iesit cand am aplicat in VS code

@hmihaella

Copy link
Copy Markdown
Author

Cand deschid htm-ul din VS code imi arata ok la contact us, dar pe netlify apar elementele aiurea, nu stiu de ce.

Comment thread src/Contact.html
<span class="Email"></span> faroeislands@gmail.com
</div>
</form>
<script>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ai foarte mare grijă la scripturile inline: nu toate funcționalitățile JS pe care vi le-am arătat se pot folosi.

Comment thread src/Contact.html
<script>
function myFunction() {
var txt;
if (confirm("Are you sure you want to submit this?")) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nu v-am zis de alert, confirm, și prompt, pentru că nu prea se mai folosesc.

De obicei se preferă să se facă un modal din HTML+CSS (cum e cel de la Bootstrap)

Comment thread src/Contact.html
}
}

window.onload = function() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aș prefera să nu folosești onload, ci să atașezi listener cu addEventListener

Comment thread src/Contact.html
areaSel.options[areaSel.options.length] = new Option(x, x,);
}

areaSel.onchange = function() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aș prefera să nu folosești onchange, ci să atașezi listener cu addEventListener

Comment thread src/Contact.html
}
}

countrySel.onchange = function() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aș prefera să nu folosești onchange, ci să atașezi listener cu addEventListener

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

Successfully merging this pull request may close these issues.

2 participants