Jump to content
  • 0

Navigation Bar Button on Mobile Device (portrait mode)


ivan77

Question

Hi,

I have a navigation bar button, it displayed fine on laptop and mobile device landscape mode.

But it is not displayed well on Portrait mode of mobile device, as you can see on attachment.

Any idea how to fix that ?

Rgds,

Here are my script :

<style>
.div-container{
  margin-bottom: 20px;
}

/* Style the links to imitate buttons*/

.btn {
  border: none;
  outline: none;
  padding: 10px 20px;
  background-color:#0092d1;
  cursor: pointer;
}

/* Style the active class, and links on mouse-over */

.active{
  background-color: #000000;
  color: white;
}

.btn:hover {
  background-color: #AEACAC;
  color: white;
}

.div-container a {
 color: white;
 text-decoration: none;
 font-size: 18px;

}

.div-container a:hover {
 color: white;
 text-decoration: none;
 font-size: 18px;
}

</style>

<div class ="div-container">
  <a href="https://c0hc.caspio.com/dp/e0cf8000c21d71068d56" class="btn">Create</a>
  <a href="https://c0hc.caspio.com/dp/e0cf8000c21d71068d56" class="btn">Monitor</a>
  <a href="https://c0hc.caspio.com/dp/e0cf8000c21d71068d56" class="btn">Validasi (FA)</a>
  <a href="https://c0hc.caspio.com/dp/e0cf8000c21d71068d56" 
class="btn">Status (FA)</a>
<a href="https://c0hc.caspio.com/dp/e0cf8000c21d71068d56" class="btn">Rekap (FA)</a>
  <a href="https://c0hc.caspio.com/dp/e0cf8000c21d71068d56" class="btn">Logout</a>
</div>

<script>
if (document.DataPageReadyHandler == undefined) {
const DataPageReadyHandler = (e) => {
 if (e.detail.appKey != '[@cbAppKey]') { return }

  const btns = document.querySelectorAll(".btn");

  btns.forEach( btn => {
           btn.addEventListener('click', function(e) {
         
            let activeElement = document.querySelector(".active");
             if(activeElement) {
                 activeElement.classList.remove("active");
                }
                e.target.classList.add("active");
             });
          });
}

document.addEventListener('DataPageReady', DataPageReadyHandler)
document.DataPageReadyHandler = 'Enabled'
}

</script>

 

LOMBA.jpg

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...