To show it, use the following −You can also go for CSS −input[type="date"]::before{ color: #ffffff; content: attr(placeholder) ": "; } input[type="date"]:focus::before { content: "" !important; }
MySQL UNION operator can combine two or more result sets hence we can use UNION operator to create a view having data from multiple tables. To understand this concept we are using the base tables ‘Student_info’ and ‘Student_detail’ having the following data −mysql> Select * from Student_info; +------+---------+------------+------------+ | id | Name | Address | Subject | +------+---------+------------+------------+ | 101 | YashPal | Amritsar | History | | 105 | Gaurav | Chandigarh | Literature | | 125 | Raman | Shimla | Computers | | 130 | Ram ... Read More
The putImageData() method places the image data onto the canvas. To animate canvas, we create a reusable ImageData object outside the main loop,var ct = c.getContext("2d", {alpha: false}); // context without alpha channel. var a = ct.createImageData(c.width, c.height); var buffer = new Uint32Array(a.data.buffer); function loop() { noise(ct); requestAnimationFrame(loop) })() function noise(ct) { var l =buffer.length - 1; while(l--) buffer[l] = Math.random() >0; ct.putImageData(a, 0, 0); }
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; }
One of the divs, when placed in another style sheet, can make menu invisible in Internet Explorer.If opacity property is used which is not a cross-border solution, it should be like the following to display −opaque { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; // first filter: alpha(opacity=90); // second }
Suppose we have to implement a basic calculator to evaluate a simple expression string. The expression string will hold only non-negative integers, some operators like, +, -, *, / and empty spaces. The integer division should take the quotient part only.So if the input is like “3+2*2”, then the output will be 7.To solve this, we will follow these steps −define a stack s, i := 0, x := an empty stringfor each character j in sif j is not a blank characterappend j into xs := x, n := length of xwhile i < nif s[i] is ‘/’, thenincrease ... Read More
In order to get latitude and longitude using an HTML5 Geolocation or any Google API, we need to add JavaScript for this. The script is as follows −if (navigator.geolocation) { /* If current position is obtained then there is success otherwise there is failure. On failure, separate error message is shown */ navigator.geolocation.getCurrentPosition(successFunc, errorFunc); } else { alert(‘Geolocation is not enabled in your browser. Please use a latest browser to supports it.'); }
Internet Explorer 8 and older versions does not support semantic elements like nav, header and article. To style semantic elements, Modernizer is used. Some CSS can be added to block CSS by default.article, header, nav, section, footer { display:block; }We can also create our own elements through JavaScript by writing following code − document.createElement('nav'); //nav is semantic element document.createElement('header'); //header is semantic element document.createElement('article'); //article is semantic element
If you want to use HTML5 canvas to draw shapes, texts and curves and also want to attach traditional DOM events like onClick or drag and drop functions, a crossbar framework Raphael is used for doing drag and drop or touch events.This technology uses SVG and XML for older versions of IE. Drag and drag using HTML is shown below. Example Raphaël · Drag-n-drop ... Read More
When there is a circle drawn on canvas and we put red color on half and grey color on a portion of a circle, then on clicking a red color, we call function1.On clicking grey part, function 2 is called and we need to use reusable path objects to store different parts, which we want to test. Click handler can be used to share the canvas and do our desired work. Path2D objects can be used to store path information.var path1 = new Path2D(); var path2 = new Path2D(); var newpaths = [path1, path 2]; // Array is ... Read More