Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Simulate a Mouse Hover Using pure JavaScript

 var element = document.getElementById('name');

element.addEventListener('mouseover', function() {

  console.log('Event triggered');

});


var event = new MouseEvent('mouseover', {

  'view': window,

  'bubbles': true,

  'cancelable': true

});


element.dispatchEvent(event);

How to use new or our own font in website or jsp pages

<style type="text/css">
@font-face
{
font-family: myFirstFont;
src: url('Sansation_Light.ttf'),
     url('Sansation_Light.eot'); /* IE9+ */
}

div
{
font-family:myFirstFont;
}
</style>