Found 601 Articles for Front End Scripts

How to rotate an image with the canvas HTML5 element from the bottom center angle?

Smita Kapse
Updated on 25-Jun-2020 07:06:08

199 Views

Translate the image dimensions to 32, 120 −context.translate(32, 120);Now rotate the canvas −context.rotate(90 * Math.PI/180);Now draw the image −context.drawImage(img, -32, -120, 64, 120);

Align HTML5 SVG to the center of the screen

Chandu yadav
Updated on 25-Jun-2020 07:07:41

3K+ Views

SVG stands for Scalable Vector Graphics and it is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer.ExampleLet us see an example of SVG −                    #svgelem {             position: relative;             left: 50%;             -webkit-transform: translateX(-20%);             -ms-transform: translateX(-20%);             transform: translateX(-20%);          }             SVG                     HTML5 SVG Circle                           To center it, add the CSS like the following −# svgelem {    margin-left:auto;    margin-right:auto;    display:block; }

How to draw sine waves with HTML5 SVG?

Anvi Jain
Updated on 16-Dec-2021 10:30:46

657 Views

To draw sine waves with SVG, use the following that closely approximates half of a sine wave. I have used a cubic-bezier approximation. Use the element.Example           SVG                     HTML5 SVG Sine Waves                           Output

Configuring any CDN to deliver only one file no matter what URL has been requested

Nitya Raut
Updated on 30-Jul-2019 22:30:22

79 Views

Use any CDN to deliver your purpose. You can use CloudFlare as a reverse proxy between your users and the CDN to fulfill your purpose.You can also create a rule that redirects whatever you want to index.html. This is how you can what you want considering that CDNs are configured to serve only static existing files as you know.Content Delivery Network (CDN) puts stuff like blobs and other static content in a cache. The process involves placing the data at strategically chosen locations and caching it. As a result, it provides maximum bandwidth for its delivery to users. Let us ... Read More

Android 4.0.1 breaks WebView HTML 5 local storage?

Lakshmi Srinivas
Updated on 25-Jun-2020 07:09:42

210 Views

To solve this problem, follow the below-given steps −For android versions less than 4.4, loading data into a webview with a file scheme as a directory like this won’t work.browser.loadDataWithBaseUrl("file:///android_asset/", html, "text/html", "UTF-8", null);Add a filename and it works on older Android versions −browser.loadDataWithBaseUrl("file:///android_asset/new.html", htmlContent, "text/html", "UTF-8", null);You can use the following too, in case your URL is http://www.demo.com −browser.loadDataWithBaseURL("http://www.demo.com", htmlContent, "text/html", "utf-8", null);

HTML5 video not working with jquery bxSlider plugin on iPad

Arjun Thakur
Updated on 25-Jun-2020 07:10:16

156 Views

To make it work, download the bxslider plugin from the official website. Get an images folder from the downloaded bxslider zip and you need to paste it into js folder of your project.All the folders will now look like − The above should solve your problem.

How to draw a 3D sphere in HTML5?

karthikeya Boyini
Updated on 25-Jun-2020 06:45:24

532 Views

To create a 3D sphere, use the HTML5 canvas. You can use the following function in your code:function display(r) {    this.point = new Array();    this.color = "blue)"    this.r = (typeof(r) == "undefined") ? 20.0 : r;    this.r = (typeof(r) != "number") ? 20.0 : r;    this.vertexes = 0;    for(alpha = 0; alpha

What HTML5 File.slice method actually doing?

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 to send the "file" to the server −var val = new XMLHttpRequest(); val.open("POST", url, true); val.onload = function (event) { }; var blob = new Blob(['demo'], {type: 'text/plain'}); val.send(blob);

How to best display HTML5 geolocation accuracy on a Google Map?

Rishi Rathor
Updated on 25-Jun-2020 06:46:14

291 Views

To display HTML5 geolocation accuracy on a Google Map, use the following code −var lat = position.coords.latitude; var longitude = position.coords.longitude; var accuracy = position.coords.accuracy; var center = new google.maps.LatLng(lat, longitude); var a = new google.maps.Marker({    position: center    map:    icon: }); var mySphere = new google.maps.Circle({    center: centerPosition,    radius: accuracy,    map:    fillColor:    fillOpacity:    strokeColor:    strokeOpacity: }); map.fitBounds(mySphere.getBounds());

CSS content: attr() on HTML5 progress doesn't work

George John
Updated on 25-Jun-2020 06:48:39

157 Views

You need to add static content in CSS to make it work.Let us see an example −HTMLYou need to add the following CSS. This is to add CSS generated content before and after the HTML5 progress element −progress::-webkit-progress-bar:before, progress::-webkit-progress-bar:after {    content: '989'; }

Advertisements