Displaying text when hovering the mouse over an element

Currently, I am working on a task that involves making a background image disappear and then revealing some text with a link in the div. Although I have managed to make the image disappear upon mouseover, I am struggling to display the text. Below is my current progress. As a beginner in this field, any help would be greatly appreciated.

/* To remove the image, the first line is used, followed by setting the link
   as hidden and attempting to make it visible, but the link remains invisible */

$('#res').mouseover(function(){
  $(this).removeClass('resume');
  $('#reslink').css(visibility,visible);
});

HTML:

<div id = "res" class = "floatleft squares resume"><a id = "reslin" class = "link" href="resume.php">link</a></div>
  <div id = "pro" class = "floatleft squares projects"><a id = "prolin" class = "link" href="projects.php"></a></div>
  <div id = "con" class = "floatleft squares contact"><a id = "conlin" class = "link" href="contact.php"></a></div>
  <div id = "abo" class = "floatleft squares about"><a id = "abolin" class = "link" href="about.php"></a></a></div>

Styles:

a{
 display: block;
 background: grey;
 height: 100%;
 width: 100%; 
 visibility: hidden;
}

If further information is required, please let me know. Thank you for your assistance.

Answer №1

Opt for

$('#reslink').css(visibility,'visible')

experiment with

$('#reslin').css('visibility','visible')

Answer №2

Could it be a simple mistake? Perhaps you meant to type #reslink instead of #reslin?

Answer №3

The identifier for your anchor should be "reslin," not "reslink"

Here is a suggestion:

 $('#reslin').css("visibility", "visible");
 or
 $('#reslin').css("display", "block");

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

Changing the direction of the submenu to the left instead of the right

My Bootstrap 4 menu has a submenu that appears to the right of the main menu. However, since the menu is positioned on the far right of the screen, it gets cut off on the right side. I'm looking for a way to make the submenu appear on the left side o ...

Is it possible to utilize the glob method for refining a current collection of file paths?

Currently, I am utilizing glob to conduct file search operations in Node, along with glob patterns for an "ignore" list. However, my goal is to utilize only the ignore list to filter a current list of files (specifically changed files from git). Is there ...

Using Javascript, print the port number to the console

I am currently developing a small Electron app with node.js and I am facing an issue with outputting the port my application is connected to for development purposes. Below is my MySQL connection code snippet: const mysql = require('mysql'); c ...

Filter JSON data by month dropdown in AngularJS

Is it possible to filter JSON data using a dropdown with all 12 months listed, and then filter the results by month? I currently have a filter set up for filtering events by type, but I'm struggling to figure out how to filter the data by month using ...

How can we identify context menu events triggered by touch actions?

In my application, I have implemented drag-and-drop functionality for elements within an SVG element using d3-drag and d3-zoom. However, on touch-enabled devices such as IE11, Edge, and Firefox, a context menu pops up after a long press, which interferes w ...

Converting JavaScript TimeStamp to MilliSeconds

How can I convert a timestamp like 09-MAR-11 04.52.43.246000000 AM to milliseconds using JavaScript? I need to achieve this conversion within JavaScript only. Any help would be greatly appreciated. Thank you. ...

Utilizing jQuery to Extract Values from a List of Options Separated by Commas

While usually simple, on Mondays it becomes incredibly challenging. ^^ I have some HTML code that is fixed and cannot be changed, like so: <a class="boxed" href="#foo" rel="type: 'box', image: '/media/images/theimage.jpg', param3: ...

What is the best way to position the sign-in modal form on the top right corner of my website?

Hey there, I'm facing a bit of an issue and can't seem to figure out what went wrong. Recently, I inserted a Bootstrap Sign In modal in my HTML file. Here's the code: <div class="text-center"> <a href="" class ...

I found myself pondering over possible solutions to rectify this parse error

I need help resolving an issue with parsing. Here is the link to the error image: https://i.stack.imgur.com/jKQat.jpg. Additionally, my HTML code connecting to the CSS site can be found here: https://i.stack.imgur.com/ST31r.jpg. The website I linked in t ...

Is it necessary to run npm install when a package does not have any dependencies?

If I have an npm package that contains all its dependencies bundled into one file using webpack, and I unpack it into the directory ./my-awesome-package/, should I still run npm install ./my-awesome-package/? I am aware of being able to specify preinstall ...

Fixing the NodeJS error "TypeError: Crud.Select_products is not a function" is crucial for the proper functioning of your application

I am attempting to access a class that has been exported from the Crud.js file, but I am encountering an error. My objective is to run a sql query. Error: TypeError: Crud.Select_products is not a function at C:\xampp\htdocs\react\c ...

Recurring occurrences of Ajax ViewComponent being triggered

I have encountered a problem with an on-click Ajax event that is triggering a Controller action/ViewComponent multiple times. The issue arises when I utilize Ajax on a button click to call a Controller Action, which inserts data into the database and then ...

The width of the absolute div shrinks to such an extent that the text starts wrapping around itself

My goal is to create a button that, when hovered over, displays a div. However, I am encountering challenges with the width and position of this div. The issue is illustrated in the images below and in the accompanying jsfiddle. When I set the positioning ...

Control the start and stop of an Express.js app in Node.js using PHP

I'm currently developing a web service using express.js in the node.js npm environment. In order to deliver this project to my client, I need to create a controller file that allows me to start and stop the server without having to use the command pr ...

Adjusting the size of images in a Bootstrap lightbox gallery

I am currently working on a website for an artist, making the galleries a key aspect. The website is built using Bootstrap, with the Lightbox for Bootstrap plugin being used for the galleries. Everything seems to be working well in terms of adjusting the i ...

Encountering a predicament when attempting to retrieve an image from an alternative

[index.jsp][5] style.css [problem][6] [folder hierarchy][7] Although everything runs smoothly when the file is located in the css directory, it fails to show any images if placed in the images folder. Kindly provide assistance. ...

Ensuring a jQuery method is only bound once to an element

Just for demonstration purposes, the code below showcases an example. Html <div> <a href='javascript:' id="foo">Foo</a> </div> <br> <div id="target"></div> JavaScript jQuery(function () { jQuery( ...

Guide on efficiently mapping an array containing arrays and simply retrieving the result

I am working with an array of arrays and I need to extract the values from each array. However, when I try to map over the arrays, I end up with just a single array and I'm not sure how to access the individual values. const arr = [ [1, 2, 3], ...

What is the correct way to execute this script?

I am a beginner in javascript and I have a script that can delete a record without refreshing the page. However, I am unsure of how to call this script. Here is what I have so far: My button: <button id="<?php echo $rrr['id']; ?>" clas ...

A combination of promises with async/await can lead to undefined return values

Currently facing an issue where my Async call to the database is returning undefined. The function "findOne" should retrieve one row from the database, but the .then(...) function is executing before the row is actually returned. I've attempted vario ...