The functionality of the image click feature becomes disabled when resizing and switching to tab view

I have added header icons for home and user. When clicked on the user image in desktop view, it should redirect to the respective page. However, when I minimize it in tab or mobile view, nothing is displayed. This issue only occurs with the user image and not the home image. Below is the code I have tried:

<div id="header">
            <a id="home" onclick="homeclick();"
             style="cursor: pointer;"><img src="images/home.png"
                height='28' width='25' /> </a>


         <a id="user" title="User" style="cursor: pointer;" class="md-trigger" data-modal="modal-8"><img
            src="images/user.png" height='25' width='25' /> </a> 



    </div>  

 <div class="md-modal md-effect-5" id="modal-8">
        <div class="md-content">
            <h2>Welcome <%=session.getAttribute("displayName")%></h2>
            <div>
                <p style="display: inline-block; width: 25%;">Last Login </p><p style="display: inline-block;width: 75%">: <%=session.getAttribute("lastLogin")%></p>
                <p style="display: inline-block; width: 25%;">Display Name </p><p style="display: inline-block;width: 75%">: <%=session.getAttribute("displayName")%></p>
                <p style="display: inline-block; width: 25%;">Email ID </p><p style="display: inline-block;width: 75%">: <span id="mail"><%=session.getAttribute("mail")%></span></p>
                <div class="allButtons">


                <button class="md-close">Close</button>
                </div>
            </div>
        </div>
    </div>

<div id="menuIcons">&#9776;</div>
    <div id="headerListIcons" style="display : none ; ">        
        </div>

        var hrz ='<ul class="header-viwmenu">';
            hrz += '<li id="home" onclick="homeclick();"'
                +'title="Home"  style="cursor: pointer"><img src="images/home.png"'
                +'height="25" width="25" /> </li>'          

            +'<li id="user" title="User" style="cursor: pointer;" class="md-trigger" data-modal="modal-8">'
            +'<img src="images/user.png" height="25" width="25"> </li>'
            </ul>'; 
            $('#headerListIcons').append(hrz);

Answer №1

To solve the issue, simply insert the script before the closing body tag. Make sure to specifically define the display attribute as block with !important rule.

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

Is there a way to remove the bold styling from text next to JavaScript?

I recently launched a website at www.mvscaccounting.com, and I added a search engine made from javascript at the bottom of the page. Next to it, I wanted to put a "all rights reserved" notice. However, whenever I try to add any text next to the search engi ...

What is the best location to store user-uploaded files on my server?

Users visiting my website have the ability to upload their own pictures. The technology stack I am using includes tomcat, apache, hibernate, and jpa. I plan on storing these images in a specific location such as /var/ImagesUploaded on my Ubuntu server. Wh ...

Implementing HTML tags in C# code

Below is an example of HTML script: <h1> This is heading one </h1> <p> This is paragraph. </p> I would appreciate any recommendations on how to add <html></html> tags to the above script using C#. ...

Integrating photospheres into your Squarespace website design

Attempting to incorporate photospheres into my Squarespace website has been a challenge. The Google Maps option is functional, but it doesn't meet my specific requirements and appears like this: <iframe src="https://www.google.com/maps/embed?pb=! ...

How can I customize the appearance of a specific tagged page on my Tumblr blog?

Although I have a solid grasp of HTML & CSS, I am encountering some difficulties with the Tag Page feature on Tumblr. Specifically, I want to change the heading displayed on the /tagged/vld tag page without altering the URL. Currently, the heading is gener ...

Enhancing the appearance of the dragged object using HTML 5 Drag And Drop API

We are currently utilizing the HTML 5 Drag and Drop API in a project. Refer to this link for more information Everything is functioning smoothly so far, but we now require distinct styles for the original item source and the dragged item. The issue we&a ...

"Enhance Navigation: Sublevel Dropdowns with the Power of Twitter

Here is a link to my fiddle: http://jsfiddle.net/xkXdy/ I am trying to create submenus for the dropdown input box in my project. Currently, it only shows the category, but I want it to display subcategories when hovered over. The dropdown functionality wo ...

Transferring PHP variable to HTML

Can someone help me figure out how to properly pass a PHP value to HTML? I'm struggling with the formatting. Any advice on how to make this work? <?php $html = ' <img src="'$val'.svg" alt="15"> //Does not ...

Responsive Menu is not compatible with the Carousel Image Slider

Hey there, Developer Community! I recently delved into programming a few days back and decided to create a homepage for an artist. The page features a responsive menu that switches to a dropdown menu with a button when the screen size shrinks. It also inc ...

Utilize Bootstrap multiselect for extracting values from optgroups and options

Having a select element with optgroups and bonded values, the structure is as follows: <select id="example-dataprovider-optgroups" multiple="multiple"> <optgroup label="Lime No. 2" value="b3a2eff6-5351-4b0f-986 ...

Organizing playing cards in a React JS application

As a beginner just starting out with React JS, I'm working on arranging cards in a medium size for my application. I came across a card design that I like and I'm seeking help to achieve something similar. Any assistance would be greatly apprecia ...

Passing data in object as key value after serializing using jQuery AJAX sortable is a common and

Using jquery ui sortable to rearrange a list with php, I extract the ids like this: var ids = $('#sort1').sortable('serialize'); It functions properly when including the ids in the ajax call data like so: data: ids To retrieve it in ...

Incapable of utilizing CSS Custom Properties (also known as CSS Variables) in conjunction with SASS @if Conditional Statements

I'm attempting to transfer CSS Custom Properties to a SASS Mixin. I can successfully use the variables directly in the desired styling. However, there seems to be a problem when utilizing a variable within an If statement. Here's an example of t ...

Execute JavaScript function with a delay once the webpage has finished loading

I am currently working on a basic function that runs when the page is loaded. However, even though the page has finished loading, there are times when it takes about half a second for the content to actually appear. While this typically wouldn't be an ...

What is the best way to implement material theme colors into my Angular2 CSS?

Suppose I want to utilize the mat-primary color as a background for a div using a CSS/SASS class, how should I reference it? My initial thought was: @import '~@angular/material/prebuilt-themes/deeppurple-amber.css'; .my-class{ background-colo ...

The functionality of JQuery's .hover() is disabled once an HTML onClick() event is activated

I am currently working on a webpage and attempting to incorporate JQuery into it for the first time. However, I seem to be encountering some issues that I believe might have simple solutions. Background Information My JQuery code only contains one event l ...

Preventing the selection of 'None selected' upon dropdown change

When using the NameTextBox Dropdown, all names are available for selection. Upon changing a name and clicking on search, the associated details are retrieved. However, by default, 'None Selected' is displayed. Is there a way to prevent 'None ...

placing a div inside another div

As I work on my website, I have created several panels with a repeating texture. To enhance the visual appeal of the site, I decided to add colored divs and adjust opacity for a tint effect instead of using separate images. The issue I'm facing is th ...

Send the entered value to an AJAX request

My AJAX post is functioning properly. However, my client has requested an additional text input field, and I am struggling to make it work. The script is quite long, so I will provide the relevant sections in the hope that it's a matter of syntax. He ...

Enhance the appearance of the input range by styling it with an additional class both before and

I have a JSF page where I am using an input range element. I want to add a different style class before and after the input range. Specifically, I want to display a plus icon (ui-icon-plusthick) before the input and a minus icon (ui-icon-minus) after the i ...