Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> JavaScript

जावास्क्रिप्ट के साथ एलिमेंट स्क्रीन की ओर फेस नहीं कर रहा हो तो विजिबल होना चाहिए या नहीं, यह कैसे सेट करें?


एलिमेंट स्क्रीन की ओर फेस नहीं कर रहा हो तो विजिबल होना चाहिए या नहीं, यह सेट करने के लिए जावास्क्रिप्ट backfaceVisibility प्रॉपर्टी का उपयोग करें।

उदाहरण

जावास्क्रिप्ट में backfaceVisibility प्रॉपर्टी लागू करना सीखने के लिए निम्न कोड चलाकर देखें:

<!DOCTYPE html> <html>    <head>       <style>          div {             width: 200px;             height: 300px;             background: blue;             color: black;             animation: mymove 2s infinite linear alternate;          }          @keyframes mymove {             to {transform: rotateY(180deg);}          }       </style>    </head>    <body>       <p>बैकफेस डिस्प्ले करने के लिए नीचे चेक करें</p>       <div id="box">          <h1>डेमो</h1>       </div>       <input type="checkbox" onclick="display(this)" checked>backfaceVisibility प्रॉपर्टी       <script>          function display(x) {             if (x.checked === true) {                document.getElementById("box").style.backfaceVisibility = "visible";             } else {                document.getElementById("box").style.backfaceVisibility = "hidden";             }          }       </script>    </body> </html>

  1. - JavaScript से एलिमेंट का निचला मार्जिन कैसे सेट करें?

    उदाहरण marginBottom प्रॉपर्टी से एलिमेंट का निचला मार्जिन सेट करें। <!DOCTYPE html> <html> <body> <p id=myID>यह डेमो टेक्स्ट है।</p> <button type=button onclick=display()>निचला मार्जिन सेट करें</button> <script> function display() {

  1. - JavaScript से एलिमेंट के सभी मार्जिन्स एक साथ कैसे सेट करें?

    उदाहरण margin शॉर्टहैंड प्रॉपर्टी से चारों मार्जिन एक साथ सेट करें। <!DOCTYPE html> <html> <body> <button type=button onclick=display()>चारों मार्जिन सेट करें</button> <p id=myID>यह डेमो टेक्स्ट है।</p> <script> function display() {

  1. - CSS से तय करें कि एलिमेंट स्क्रीन की ओर न होने पर भी दिखे या नहीं

    यह तय करने के लिए कि एलिमेंट स्क्रीन की ओर न होने पर दिखे या नहीं, backface-visibility प्रॉपर्टी का उपयोग करें: उदाहरण <!DOCTYPE html> <html> <head>    <style>       .demo1 {          position: relative;