Nitya Raut has Published 276 Articles

How to reconnect to websocket after close connection with HTML?

Nitya Raut

Nitya Raut

Updated on 25-Jun-2020 05:55:58

4K+ Views

Recreate the socket to reconnect it. The websockets are designed to stay open. You can also go with the method to have the server close the connection. Through this, the websocket will fire an onclose event and would amazingly continue attempting to make the connection.In addition, when the server is listening ... Read More

addEventListener for keydown on HTML5 Canvas

Nitya Raut

Nitya Raut

Updated on 24-Jun-2020 14:23:57

520 Views

Use the tabindex attribute on the canvas element for addEventListener on Canvas −var myTarget, myCanvas; window.onload = function() {    myCanvas = document.getElementById('canvas');    document.addEventListener('mousedown', function(event) {       myTarget = event.target;       alert('This is mousedown event.');    }, false);        document.addEventListener('keydown', function(event) {   ... Read More

Fade In Tooltip with CSS Animation

Nitya Raut

Nitya Raut

Updated on 24-Jun-2020 07:15:39

290 Views

To fade in tooltip text with CSS, you can try to run the following code:ExampleLive Demo           .mytooltip .mytext {          visibility: hidden;          width: 140px;          background-color: blue;          color: #fff;   ... Read More

How to position tooltips correctly with CSS

Nitya Raut

Nitya Raut

Updated on 24-Jun-2020 06:54:07

5K+ Views

To position tooltips correctly, use the right, left, top and bottom properties.Let us see how to position tooltips on the right:ExampleLive Demo           .mytooltip .mytext {          visibility: hidden;          width: 140px;          background-color: blue;   ... Read More

Select elements whose attribute value ends with a specified value with CSS

Nitya Raut

Nitya Raut

Updated on 24-Jun-2020 06:00:54

211 Views

To select elements whose attribute value ends with a specified value, use the [attribute$ = ”value”] selector.You can try to run the following code to implement the CSS [attribute$ = "value"] Selector,ExampleLive Demo                    [alt$ = Connect] {             border: 5px solid blue;             border-radius: 5px;          }                              

How to select elements with a specified attribute and value with CSS

Nitya Raut

Nitya Raut

Updated on 23-Jun-2020 16:18:28

142 Views

Use the [attribute = ”value”] selector to select elements with a specified attribute and value.You can try to run the following code to implement the CSS [attribute = "value"] Selector. Here, we have considered the attribute as rel, Example:Live Demo                 ... Read More

Select elements with the specified attribute starting with the specified value with CSS

Nitya Raut

Nitya Raut

Updated on 23-Jun-2020 15:20:41

73 Views

Use the [attribute| = ”value”] selector to select elements with the specified attribute starting with a specified value.You can try to run the following code to implement CSS [attribute| = ”value”] Selector,ExampleLive Demo                    [alt |= Tutor] {             border: 5px solid orange;             border-radius: 5px;          }                              

Which is the best JavaScript compressor?

Nitya Raut

Nitya Raut

Updated on 23-Jun-2020 12:24:06

97 Views

Here are some of the best JavaScript compressors available −Google Closure CompilerThe Google Closure compiler runs JavaScript quickly and used for a superior JavaScript. It parses your JavaScript, analyzes it, removes dead code, rewrites, and minimizes what's left.JSMinIf you want to minify, then use the JSMin to remove unnecessary comments.YUI ... Read More

How to set the CSS property that the transition effect is for with JavaScript?

Nitya Raut

Nitya Raut

Updated on 23-Jun-2020 11:30:59

78 Views

Use the transitionProperty in JavaScript to set the CSS property. You can try to run the following code to return the CSS property that the transition effect is for with JavaScript −Example                    #div1 {             ... Read More

With JavaScript how to change the width of a table border?

Nitya Raut

Nitya Raut

Updated on 23-Jun-2020 10:58:32

705 Views

To change the width of a table border, use the DOM border property. You can try to run the following code to change the width of a table border in JavaScript −Example                    function borderFunc(x) {             document.getElementById(x).style.border = "5px dashed blue";          }                                             One             Two                                 Three             Four                                 Five             Six                                          

Advertisements