Αυτός ο ιστότοπος θα έχει περιορισμένη λειτουργικότητα, όσο εκτελούμε εργασίες συντήρησης για να βελτιώσουμε την εμπειρία σας. Αν ένα άρθρο δεν επιλύει το ζήτημά σας και θέλετε να κάνετε μια ερώτηση, η κοινότητα υποστήριξής μας είναι έτοιμη να σας βοηθήσει στο Twitter (@FirefoxSupport) και στο Reddit (/r/firefox).

Αναζήτηση στην υποστήριξη

Προσοχή στις απάτες! Δεν θα σας ζητήσουμε ποτέ να καλέσετε ή να στείλετε μήνυμα σε κάποιον αριθμό τηλεφώνου ή να μοιραστείτε προσωπικά δεδομένα. Αναφέρετε τυχόν ύποπτη δραστηριότητα μέσω της επιλογής «Αναφορά κατάχρησης».

Μάθετε περισσότερα

Last checked input's css state persist after page reload

  • 2 απαντήσεις
  • 1 έχει αυτό το πρόβλημα
  • 12 προβολές
  • Τελευταία απάντηση από cor-el

more options

Hi, I use this kind of css to manage the appearance of my input radio button state :

input ~ div {

 background-color: #4a4a4a;
 padding: 8px;
 font-weight: 400;
 height: 100%;
 width: 100%;

} input:checked ~ div {

 background-color: #363636;
 padding: 8px;
 font-weight: 400;
 height: 100%;
 width: 100%;

}

It works perfectly but when I reload the page, the css rule input:checked ~ div still apply to the last checked while it is no longer checked in the DOM…

for exemple I have 3 buttons : 1 - not checked 2 - not checked 3 - I checked this one, the rule input:checked ~ div is applied

If I reload the page : 1 - checked, return to default, works as designed, but the rule input:checked ~ div is not applied 2 - not checked 3 - not checked, but the rule input:checked ~ div is still applied

It's for commerce products variations, really annoying as when the customer reload the page, the displayed price is for the first button as designed, but it's the last button that is highlighted…

This issue is not present with other browsers…

Has anyone ever experienced this problem ? Thanks for your help

Hi, I use this kind of css to manage the appearance of my input radio button state : input ~ div { background-color: #4a4a4a; padding: 8px; font-weight: 400; height: 100%; width: 100%; } input:checked ~ div { background-color: #363636; padding: 8px; font-weight: 400; height: 100%; width: 100%; } It works perfectly but when I reload the page, the css rule input:checked ~ div still apply to the last checked while it is no longer checked in the DOM… for exemple I have 3 buttons : 1 - not checked 2 - not checked 3 - I checked this one, the rule input:checked ~ div is applied If I reload the page : 1 - checked, return to default, works as designed, but the rule input:checked ~ div is not applied 2 - not checked 3 - not checked, but the rule input:checked ~ div is still applied It's for commerce products variations, really annoying as when the customer reload the page, the displayed price is for the first button as designed, but it's the last button that is highlighted… This issue is not present with other browsers… Has anyone ever experienced this problem ? Thanks for your help
Συνημμένα στιγμιότυπα

Τροποποιήθηκε στις από το χρήστη llyomll

Όλες οι απαντήσεις (2)

more options

Moreover, the third button cannot be clicked again, despite in the DOM it is the first button that have the attribute checked="checked" after page reloading

more options

Try to ask advice at a web development oriented forum.