Ankith Reddy has Published 1070 Articles

Geolocation HTML5 enableHighAccuracy True, False or What?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:35:34

196 Views

For Geolocation enableHighAccuracy, you need to set it to true −enableHighAccuracy: trueIf you still fail in getting the result i.e. handling the timeout error, then again try it withenableHighAccuracy: falseThe above would work on Android, Chrome, and Firefox as well.

Show the flex lines with spaces all around with CSS

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:30:43

86 Views

Use the align-content property with value space-around to add space around the flex lines.You can try to run the following code to implement the space-around valueExampleLive Demo                    .mycontainer {             display: flex;         ... Read More

Detecting HTML click-to-call support in JavaScript

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:19:05

161 Views

The tel: protocol is supported by almost every mobile device nowadays. This includes Safari on iOS, Android Browser, Symbian browser, Opera Mini, etc.Add it like this −if (/(HTC825)/i.test(navigator.userAgent)){    $("a[href^='tel:']").each(function(){       this.href = this.href.replace("tel:", "wtai://wp/mc;");    }); }

Usage of CSS grid-gap property

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:14:04

109 Views

Set gap between Grid rows and columns with CSS. You can try to run the following code to implement the grid-gap property.ExampleLive Demo                    .container {             display: grid;             ... Read More

Playing MP4 video in WebView using HTML5 in Android

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:12:13

708 Views

To play MP4 video in WebView, you need to first declare Content Provider in Manifest −Implement open file with open() method −URI myURL = URI.create("file:///mypath/new.mp4"); File f = new File(myURL); ParcelFileDescriptor p =    ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY); return p;

Passing mouse clicks through an overlaying HTML element

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:05:20

724 Views

Retrieve the mouse coordinates in the click event. Now, retrieve the element by hiding your overlay, and use the following. After that, redisplay the overlay −document.elementFromPoint(x, y)You can also use the following CSS −div {    pointer-events:none; }

How to disable zooming capabilities in responsive design with HTML5?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:02:19

636 Views

To disable zooming capabilities in responsive design, you need to create a META viewport tag.With that, set the user-scalable property to 'no' like −user-scalable=noAdd the following in your HTML code to disable zooming capabilities in responsive design −

What HTML5 File.slice method actually doing?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 06:46:49

131 Views

The HTML5 file Blob.slice() method is useful for creating a Blob object containing the data. This data is in the specified range of bytes of the source Blob.Let us see an example to send and receive binary data using slice(). This example sends a text and uses the POST method ... Read More

HTML5 Canvas Circle Text

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 06:37:12

330 Views

To create a text inside circles in canvas, use the −context.beginPath();ExampleThe following is the canvas −$("#demo").on("click", "#canvas1", function(event) {    var canvas = document.getElementById('canvas1');       if (canvas.getContext) {          var context = canvas.getContext("2d");          var w = 25;         ... Read More

Use CSS max-width property for responsive image

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 06:10:13

304 Views

You can try to run the following code to implement the max-width property for the responsive imageExampleLive Demo                          img {             max-width: 100%;             height: auto;          }                     To check the effect, you need to resize the browser.          

Advertisements