logo
down
shadow

javascript - insert div after elements with a certain class on mouseover


javascript - insert div after elements with a certain class on mouseover

By : user2955948
Date : November 22 2020, 10:48 AM
should help you out Please make sure menuHelp is a nodeList, so you should use document.querySelectorAll; When the mouse enter, the value of i is menuHelp.length. so you should use this, like insertAfter(this, menuHelpPopup)
code :


Share : facebook icon twitter icon
Show Html Elements above other Elements on MouseOver using Javascript

Show Html Elements above other Elements on MouseOver using Javascript


By : user1360770
Date : March 29 2020, 07:55 AM
it should still fix some issue What you need is an absolutely-positioned div-element, which you position the way you want it to appear. Then you hide it with style="display: none;", and on mouseover of the right element, you show it. With jQuery that'd be:
code :
HTML:
<div id="layer" style="display: none; position: absolute; top: 10px; left:   300px;">something</div>
Javascript:
$('#elementToHover').mouseover(function() {
    clearTimeout(timeout);
    $('#layer').show();
});
var timeout;
$('#elementToHover').mouseout(function() {
    timeout = setTimeout("hide()", 1000);
});
$('#layer').mouseover(function() {
    clearTimeout(timeout);
});
$('#layer').mouseout(function() {
    timeout = setTimeout("hide()", 1000);
});
function hide() {
    $('#layer').hide();
}
How do you Javascript style area elements on mouseover?

How do you Javascript style area elements on mouseover?


By : miki729
Date : March 29 2020, 07:55 AM
may help you . mapper.js can be used for this.
code :
<script type="text/javascript" src="wz_jsgraphics.js"></script>
<script type="text/javascript" src="mapper.js"></script>
<div>
<img src="..." class="mapper" usemap="..." alt="...">
</div>
<map>
...
<area shape="poly" class="noborder icolor00ff00" href="#" coords="...">
...
</map>
<map>
...
<area shape="poly" id="blue" rel="green,red" href="#" coords="...">
<area shape="poly" id="green" rel="red,blue" href="#" coords="...">
<area shape="poly" id="red" rel="green,blue" href="#" coords="...">
...
</map>
<map>
...
<area shape="rect" id="black" class="icolor000000 forcegroup" rel="green,red,blue" href="#" coords="...">
...
</map>
On mouseover fade other elements with same class with the help of jQuery

On mouseover fade other elements with same class with the help of jQuery


By : Mkinnison
Date : March 29 2020, 07:55 AM
this will help I have couple of divs with background made of css sprites, they all share the same class - .picture.
code :
var elems = $('.picture');
elems.on('mouseenter mouseleave', function(e) {
    elems.not(this).stop(true).fadeTo('fast', e.type=='mouseenter'?0.5:1);
});
How to hide and show elements on mouseover of containing element using Javascript?

How to hide and show elements on mouseover of containing element using Javascript?


By : Lyhnmyu
Date : March 29 2020, 07:55 AM
With these it helps You can use CSS transition to fade effect.
First set the opacity of all paragraphs to zero. When hover over heading, increase the opacity of paragraph and decrease the opacity of heading gradually.
code :
.container p {
  opacity: 0;
  -webkit-transition: opacity 1s ease-in;
  -moz-transition: opacity 1s ease-in;
  -ms-transition: opacity 1s ease-in;
  -o-transition: opacity 1s ease-in;
  transition: opacity 1s ease-in;
}
.container h1 {
  -webkit-transition: opacity 1s ease-in;
  -moz-transition: opacity 1s ease-in;
  -ms-transition: opacity 1s ease-in;
  -o-transition: opacity 1s ease-in;
  transition: opacity 1s ease-in;
}
.container:hover p {
  opacity: 1;
}
.container:hover h1 {
  opacity: 0;
}
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
$('.container').hover(function() {
  $(this).find('p').animate({
    opacity: 1
  }).end().find('h1').animate({
    opacity: 0
  });
}, function() {
  $(this).find('p').animate({
    opacity: 0
  }).end().find('h1').animate({
    opacity: 1
  });
});
.container p {
  opacity: 0;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
<div class="container">
  <h1 class="name">Title</h1>
  <p>description</p>
</div>
Insert elements after each image with a specific class using plain javascript

Insert elements after each image with a specific class using plain javascript


By : Andrey Terekhov
Date : March 29 2020, 07:55 AM
I hope this helps . You can use querySelectorAll to find elements with a specific tag and class in the same way as jQuery:
code :
var imgs = document.querySelectorAll("img.img-caption");
insertAfter(imgs[i], NewSpan);
//insertAfter() needs to be updated
function insertAfter(referenceNode, newNode) {
  referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}

function inserCaption() {
  var imgs = document.querySelectorAll("img.img-caption");

  for (var i = 0; i < imgs.length; i++) {
    var NewSpan = document.createElement("span");
    var Caption = imgs[i].getAttribute("title");
    NewSpan.innerHTML = Caption;
    
    insertAfter(imgs[i], NewSpan);
  }
}
<img title="Hi" class="img-caption" src="http://i.imgur.com/KnX16nj.png" />

<img title="Hello" class="img-caption" style="height:126px; width: auto;" src="http://i.imgur.com/naajTCH.png" />

<button style="display:blocK" onclick="inserCaption()">Display Image Title</button>
Related Posts Related Posts :
  • Mocha JS: How to reuse assertions within a spec?
  • Is ember.js stable enough to use in a real world project?
  • jQuery Load() not loading within div
  • encode stream from webCam h264
  • Regex to find pattern, return subpattern
  • Why does this regex to remove empty <p></p> tags from a string fail?
  • Rails: pass data to javascript
  • Quickest way to check if a number is in a set?
  • Phonegap events online/offline not working
  • In HTML5, please explain the meaning of '?' in the statement
  • Form to use AJAX rather than a page refresh but also utilise error handling?
  • JQuery Script looping error
  • different size divs align top left
  • Image fade-in when webpage finishes loading
  • Seeking HTML5 audio element causes delay (breaks sync)
  • How can I read & write data to a new tab in Firefox?
  • jQuery or JS turn all words into italic type
  • iOS css -webkit-transform: scale doesn't offset touch events
  • Populate select list using javascript
  • Can you work out why my .js file doesn't seem to be linking to my html?
  • Make slideToggle effect only one element at a time
  • Output sound using JavaScript
  • What is the analytics.js equivalent of _trackPageview found in ga.js
  • How can I check if a JS file has been included already?
  • hasClass and condition not working
  • EDITED: I'm having issues with a button and its function
  • Importing XML in HTML with javascript
  • Create new function in contentScriptFile in Firefox extension
  • Should I build Node.js from source or download the OS X installer?
  • How to enforce integer sizes in JS? (TypeScript?)
  • How to update the JSON object without deleting old values using javascript
  • Reading a javascript variable containing a string into another file
  • Possible to prevent 403 errors from logging to the web console?
  • Jquery Accordion - Expand and collapse div on hover
  • jquery .hide() function - Hide mobile, Display Desktop
  • Holding password in javascript variable - security implications?
  • JQPlot trouble to render vertical stacked bar and horizontal legend
  • counts days inbetween then add class to those days with nested divs?
  • Marionette.js with Rails (Devise) Authentication
  • javascript anonymous function evaluation idiom
  • Why am I losing the decimal when working this equation in Javascript?
  • Site redirects to index.php after being open while making calls to an API using AJAX
  • How to determine when multiple callbacks are all done
  • How to update Yeoman dependencies?
  • How can I do a /resolve with the Soundcloud Javascript SDK?
  • I'm not able to call a named callback function
  • How to get value of Paragraph element contained in <div> in HTML using JavaScript
  • Javascript - Get value from textbox and save it on a string
  • Backbonejs collection not populated, but fetch works
  • when function's internal [[scope]] property is assigned?
  • Wrapping around the edges in a 2d array (game of life)?
  • Clone div with all nested elements along with events in pure javascript
  • How to get response text?
  • Setting and retrieving cookies in javascript
  • Passing parameter with double quotes
  • finding the meaning of the obfuscated javascript
  • Socket.io - Sending data from a pusher stream to the client
  • How to determine the visibility li's in a scrollable ul
  • How to create Scrolling Effect like Grouek website
  • How to display a state in parents template in ui-router
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org