How do I set a condition to pop-up a block when we click a button using the HTML/CSS editor?
Thanks in advance.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How do I set a condition to pop-up a block when we click a button using the HTML/CSS editor?
Thanks in advance.
Hi,
You can use the following code to raise a pop-up
HTML:
<button id="popupButton">Click Me</button>
<div id="popupBlock" class="hidden">
<!-- Content of the popup goes here -->
<p>This is the popup content.</p>
</div>
CSS:
#popupBlock {
display: none; /* Initially hidden */
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 20px;
background-color: #fff;
border: 1px solid #ccc;
}
Javascript:
<script>
const popupButton = document.getElementById('
const popupBlock = document.getElementById('
popupButton.addEventListener('
popupBlock.classList.toggle('
});
</script>
Hope it helps
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
2
مارس 15
|
3282 | ||
|
1
مارس 20
|
13256 | ||
|
0
ديسمبر 19
|
2299 | ||
|
7
ديسمبر 24
|
25299 | ||
|
0
مارس 15
|
3953 |