Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 39 of 81

What are Python coding standards/best practices?

Chandu yadav
Chandu yadav
Updated on 05-Mar-2020 702 Views

You can use the PEP8 guide as a holy grail. Almost all python world uses this guide to write clean understandable and standard python code. This is available as an extension as a linter for all modern text editors. You can check it out at  http://www.python.org/dev/peps/pep-0008/Properly Structure your folders. All projects need proper structuring. This helps organize code better. Python has an opinionated folder structure that you should use.README.rst LICENSE setup.py requirements.txt sample/__init__.py sample/core.py sample/helpers.py docs/conf.py docs/index.rst tests/test_basic.py tests/test_advanced.pyUse doctests. The doctest module searches for pieces of text that look like interactive Python sessions, and then executes those sessions to ...

Read More

Usage of :link pseudo-class in CSS

Chandu yadav
Chandu yadav
Updated on 04-Mar-2020 96 Views

The :link pseudo-class is used to add special style to an unvisited link. Possible values could be any color name in any valid format. Example                    a:link { color:#000000; }                                Demo Link          

Read More

CSS min-width property

Chandu yadav
Chandu yadav
Updated on 04-Mar-2020 159 Views

The min-width property is used to set the minimum width that a box can be. The value of the min-width property can be a number, a length, or a percentage.Example                            This paragraph is 100px high and min width is 400px          This paragraph is 100px high and min width is 400px              

Read More

HTML5 Canvas & z-index issue in Google Chrome

Chandu yadav
Chandu yadav
Updated on 04-Mar-2020 848 Views

When we apply z index to a canvas whose position is fixed, it stop causes chrome to render all other elements which have position:fixed properly. This only happens if canvas is greater than 256X256 px in size.Wrap both h1 and canvas with the fixed div and solves the issue −    Test Title     The following is the CSS −h1{    position: fixed; } body{    height: 1500px; } canvas{    position: fixed; z-index: -10; }

Read More

How can I use the HTML5 canvas element in IE?

Chandu yadav
Chandu yadav
Updated on 04-Mar-2020 358 Views

Use excanvas JavaScript library to use HTML5 canvas in Internet Explorer(IE).The excanvas library is an add-on, which will add the HTML5 canvas functionality to the old IE browsers (IE7-8).Firefox, Safari and Opera 9 support the canvas tag to allow 2D command-based drawing operations.ExplorerCanvas brings the same functionality to Internet Explorer. To use the HTML5 canvas element in IE, include the ExplorerCanvas tag in the same directory as your HTML files, and add the following code to your page in the head tag.

Read More

HTML5 inline video on iPhone vs iPad/Browser

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 550 Views

The allowsInlineMediaPlayback  property of a UIWebView) enables/ disables in line media playback in the iOS web browser for a native app. By default, on iPhone this is set to NO, but on iPad its set to YES. Hence, the native video player takes over the screen, thus obstructing us from playing other dynamic content simultaneously with the video Adjust this behaviour in HTML as follows − iOS10+ In iOS 10+, Apple has now enabled the attribute playsinline in all the web browsers on iOS 10. Now, play around with this easily −

Read More

How to copy the content of one HTML5 Canvas to another Canvas locally?

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 3K+ Views

The drawImage() method is used to draw image, canvas and videos on canvas. It can also draw part of image and increase or decrease the image size.ExampleLet us see an example −//context grabbed from your destination canvas ctx = destinationCanvas.getContext('2d'); //drawImage() called passing the source canvas directly dCtx.drawImage(sourceCanvas, 0, 0);In this code, firstly the image is copied from the source canvas. The sourceCanvas can be a HTMLImageElement, HTMLVideoElement, or a HTMLCanvasElement. A canvas drawing context cannot be used as a source. If a canvas drawing context is your source canvas then there is a reference to the original canvas ...

Read More

Execute a script when the cue changes in a <track> element in HTML?

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 169 Views

When the cue changes, the oncuechange attribute triggers in HTML. It works with the element.              Your browser does not support the video element.          

Read More

Execute a script at the start of a drag operation in HTML?

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 143 Views

Use the ondragstart attribute in HTML to execute a script at the start of a drag operation in HTML.ExampleYou can try to run the following code to implement the ondragstart attribute −                    drag {          float: left;          width: 100px;          height: 35px;          border: 2px dashed #876587;          margin: 15px;          padding: 10px;          }                       ...

Read More

Execute a script each time the volume of a video/audio is changed in HTML?

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 159 Views

The onvolumechange attribute trigger when the user change the volume of the video or audio accessed on the web page. This change can be volume up, volume down, mute, etc.ExampleYou can try to run the following code to implement onvolumechange attribute −           Play                                    Your browser does not support the video element.                      function myFunction() {          document.getElementById("test").innerHTML = "Volume changed";          }          

Read More
Showing 381–390 of 810 articles
« Prev 1 37 38 39 40 41 81 Next »
Advertisements