The Transformicons by Navicon featuring a stylish blue outline

While experimenting with the navicon from sara soueidan, I noticed a blue selector around the icons that I can't seem to get rid of. Is this something specific to the method used, or just a misunderstanding of jQuery?

Here is the code snippet: http://jsfiddle.net/Ah6XA/


    <button type="button" role="button" aria-label="Toggle Navigation" id="mbtn" class="lines-button x">
      <span class="lines"></span>
    </button>
#mbtn {
      display: inline-block;
      margin: 0 1em;
      border: none;
      background: none;
    }
    #mbtn span {
      display: block;
    }

    .lines-button {
      padding: 2rem 1rem;
      transition: .3s;
      cursor: pointer;
      /* */
    }

    .lines {
      display: inline-block;
      width: 4rem;
      height: 0.57143rem;
      background: #211f20;
      border-radius: 0.28571rem;
      transition: 0.3s;
      position: relative;
    }
    .lines:before, .lines:after {
      display: inline-block;
      width: 4rem;
      height: 0.57143rem;
      background: #211f20;
      border-radius: 0.28571rem;
      transition: 0.3s;
      position: absolute;
      left: 0;
      content: '';
      -webkit-transform-origin: 0.28571rem center;
      transform-origin: 0.28571rem center;
    }
    .lines:before {
      top: 1rem;
    }
    .lines:after {
      top: -1rem;
    }

    .lines-button:hover .lines:before {
      top: 1.14286rem;
    }
    .lines-button:hover .lines:after {
      top: -1.14286rem;
    }

    .lines-button.close {
      -webkit-transform: scale3d(0.8, 0.8, 0.8);
      transform: scale3d(0.8, 0.8, 0.8);
    }

    .lines-button.x.close .lines {
      background: transparent;
    }
    .lines-button.x.close .lines:before, .lines-button.x.close .lines:after {
      -webkit-transform-origin: 50% 50%;
      transform-origin: 50% 50%;
      top: 0;
      width: 4rem;
    }
    .lines-button.x.close .lines:before {
      -webkit-transform: rotate3d(0, 0, 1, 45deg);
      transform: rotate3d(0, 0, 1, 45deg);
    }
    .lines-button.x.close .lines:after {
      -webkit-transform: rotate3d(0, 0, 1, -45deg);
      transform: rotate3d(0, 0, 1, -45deg);
    }

var anchor = document.querySelectorAll('button');

[].forEach.call(anchor, function(anchor){
  var open = false;
  anchor.onclick = function(event){
    event.preventDefault();
    if(!open){
      this.classList.add('close');
      open = true;
    }
    else{
      this.classList.remove('close');
      open = false;
    }
  }
});

Answer №1

To eliminate the border on mobile devices, simply include the following code:

-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Sorting data in a Footable table by an unfinished line

My data table contains various lines like: 97.5%, 10/30, 41 RPM, 3.6 seconds, $4750, $100 When I set the type data-type = "number" in the rows, everything is stripped except for the numbers. However, I need the output to remain complete as shown in the ex ...

Refreshing a HTML table by retrieving data from a session variable

I'm still learning the ropes when it comes to JSP, jQuery, and AJAX. I have a JSP page that utilizes a table populated with values from a List variable stored in session. Below is the code snippet: <table id="someData" class="display" width="95%"& ...

The vertical scrolling issue arises when the content exceeds the height of the screen

Seeking a solution to enable scrolling of users within a flexbox menu, I've come across an interesting discovery. When setting a specific height in pixels for my nav element (like 100px), everything works perfectly. However, when I set the height to 1 ...

Save the current date in the browser's localStorage

With jQuery Mobile 1.3, I successfully gathered and displayed values from input fields using localStorage through this function: <script type="text/javascript"> function datosCliente (info) { localStorage.setItem(info.name, info.valu ...

Tips for ensuring a functioning dropdown menu while maintaining a fixed navigation bar position

I am facing an issue with my navigation bar. I have set the position to fixed to keep it at the top, but this is causing the drop-down functionality to stop working. Please advise on where I should move the position fixed property so that my nav bar remai ...

Having trouble integrating jQuery into an Angular CLI project

I'm trying to incorporate jQuery into my angular project created with angular cli. I followed the instructions provided on this website: To begin, I installed jQuery by running: npm install --save jquery; Next, I added type definitions for jQ ...

When the Add button in AngularJS is clicked, a new popup page should appear by concealing the parent page

I am currently working on a project that involves using the AngularJS/Breeze framework within the HotTowel Template. One of the requirements I have is to include a button/link labeled "Add" on the parent.html page. When this button is clicked, it should t ...

What is the most effective method for determining the distance between two UK Postcodes?

Can you suggest a reliable method for calculating the distance between two UK postcodes in order to determine if they are within range? I do not intend to display a map, but instead provide a list of results for valid locations. For example, showing loca ...

Require assistance in constructing a tree structure utilizing the jstree plugin and JSON within the MVC framework?

I am struggling to create a tree structure using the jstree plugin and Json within my MVC 4 project. However, there seems to be an error in my implementation that I can't seem to identify. Here is the Json snippet: [OutputCache(Duration = 0)] ...

Resizing background images to their original size using jQuery

Can anyone help me figure out the actual size in pixels of a background image that is being displayed? <style> body { background-image: url(background.jpg); background-size: contain; } </style> I tried using jQuery to get the size of ...

Using jQuery, how can I add value to every input when the option is changed?

I need help changing the values of all input:text elements based on selections from a select menu. Specifically, I want to change only the matched td.class values from the data-pset attribute inside the <select>. As a beginner in jQuery, I can only ...

The container cannot contain the overflowing DIV

I have 4 different divisions named outer, inner, title, and content. My goal is to place the inner div inside the outer div, with both the title and content divs positioned within the inner div, one above the other. I have set the outer and inner divs to b ...

I found myself continuously revolving four images along a circular border, each time revealing the corresponding content. However, I only required the content from one of the images at a time

I attempted to animate the rotation of a circle and display the content of a specific image by pausing it for a period of time. However, I am unsure how to halt the animation and display the content of the specified image. Here's what I tried: HTML C ...

Guide to automatically update div with new table rows with the help of Ajax

Can you assist me in updating the div called "table" that contains a table fetching rows from the database? <div id="table"> <h1 id="Requests"> <table></table> </h1> </div> <button id="refresh-btn"&g ...

Ensure that all of the <li> elements within a <ul> container have equal widths

I've been grappling with this problem for the past day, and despite restarting from scratch multiple times, I can't seem to make a horizontal CSS flyout header function as intended. The dropdown section should expand to fit the content width (id ...

Stop the erratic movement of elements in Chrome

Visit the following link: . Upon loading the page in Chrome, there seems to be a slight movement of every other element between the title and lyrics (including key selector and links). The same issue occurs when hovering over these sections. It appears to ...

Resetting ajax success message when modal is closed

Currently utilizing w3.css and its modal feature, I am encountering an issue with clearing the message displayed after a successful ajax call once the window is closed. Even though I have implemented code to clear the message upon closing the window (by cl ...

Capture an image of the element

Hi there, I'm currently attempting to use PhantomJS to capture a screenshot of a specific element. I'm utilizing the PhantomJS bridge for Node.js: phantom Here's what I have so far: page.includeJs('http://ajax.googleapis.com/ajax/libs ...

Needing to scroll within a dropdown menu has become a necessity for me

While working with Selenium for automation, I encountered a challenge in clicking on a hidden element within a dropdown menu. The issue is that when scrolling down the page, the entire page moves instead of just the specific dropdown. Here is the HTML cod ...

Using Angular with OpenStreetMap and $routeProvider allows for dynamic routing and

Check out this awesome single page app that I found: https://github.com/tombatossals/angular-leaflet-directive/blob/master/examples/simple-example.html However, I am looking to enhance it by adding a menu... <html ng-app="App"> <head> <lin ...