Home>
[jQuery]
$(function () {
$(". area");
$(". fadein_img_wrapper img"). hide ();
// Link button = i
// image = k
$(". area"). each (function (i) {
console.log (($(this) + i));
$(". fadein_img_wrapper img"). each (function (k) {
console.log (($(this) + k));
$(". area"). on ("click", function () {
if (k == i) {
$(". fadein_img_wrapper img"). stop (). fadeToggle ();
}
});
});
});
});
[HTML]
<figure>
<map name = "ImageMap">
</map>
<!-/. fadein_img_wrapper->
</figure>
[CSS]
. factory_wrapper {
position: relative;
}
.factory_wrapper figure {
padding-top: 80px;
text-align: center;
}
.factory_wrapper .fadein_img_wrapper img {
position: absolute;
top: 100px;
left: 150px;
}
** ###
When you click each link on the HTML image map, the image associated with it will fade in
I want to
Click the image map link to see the image itself.
However, since all image map links and images associated with each image map are acquired with each of jQuery,
If i click on any image map link, the previous element will be overwritten by the element that was looped later
The last acquired image will be displayed.
-
Answer # 1
Related articles
- javascript - display button elements in two lines in a zigzag pattern
- javascript - i want to display a local image in nodejs
- javascript - switching image display vuejs
- javascript - display image preview on tweet post edit page
- javascript - i want to display a preview on the image post edit page
- javascript - i want to move the image horizontally with the button
- javascript - i'm new to js about image change display in attr
- javascript - i want to display a drop-down menu using css and js in html
- java - how to display background image in jsp
- javascript - i want to clear a radio button with a button multiple times in one form
- html - i want to display the image so that it does not protrude from the body
- image display in python
- javascript - after completing the inquiry form, the button will be able to be able to send
- i want to make a 〇 × game (tic tac toe) with javascript i want to display 〇 × on the board
- javascript - js multiple image output and deletion (initialization) loop method
- to display the url enclosed in with the javascript p tag
- javascript - [heroku] you will not be able to access the uploaded image after a certain period of time
- javascript - i want to change the display by selecting the radio button
- java - i want to display a pop-up with a text copy button in ajax communication (response from the server)
- javascript - i want to display pdf from url using react-pdf
Related questions
- javascript : Anti-aliasing SVG text before applying filter
- javascript : Dropdown menu when hovering over the parent menu
- javascript : Draw a "round" line without breaks
- javascript : Disabled option
- javascript : Side dropdown menu
- javascript : How to draw a shape in the middle of the cursor
- javascript : Updating values in a table using ajax
- javascript : Displaying a random number when you click on the button
- javascript : How to start learning JS /CSS /HTML [duplicate]
- javascript : Draw a parabola without breaks