
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 598 Articles for Front End Scripts

424 Views
Yes, it is possible. Create a pattern using the image, and then set the pattern to fillStyle.Here, obj is our image object −var context = canvas.getContext("2d"); var pattern = context.createPattern(obj, "repeat"); context.fillStyle = pattern;You need to manipulate the image to fit an arbitrary polygon −context.save(); context.setTransform(m11, m12, m21, m22, dx, dy); context.drawImage(obj); context.restore();

143 Views
You can try to run the following code to detect folders in Safari −Array.prototype.forEach.call(e.dataTransfer.files, function (file) { var r = new FileReader(); r.onload = function (event) { addFile(file); }; r.onerror = function (event) { alert("Uploading folders isn't supported in Safari browser!"); } r.readAsDataURL(file); });

150 Views
Flash provides amazing GUI and lots of visual features for animations. It allows the user build everything inside a particular platform without a full integration into the browser wrapped inside the browser with the main scopes that are multimedia and other kinds of animation.HTML5 element gives you an easy and powerful way to draw graphics using JavaScript. It can be used to draw graphs, make photo compositions or do simple (and not so simple) animations.Here is a simple element which has only two specific attributes width and height plus all the core HTML5 attributes like id, name, and ... Read More

449 Views
For HTML5 Canvas degree symbol, try to run the following code − body { margin:5em; background:#eee; text-align:center } canvas { background:#fff; border:2px solid #ccc; display:block; margin:3em auto } var c = document.getElementsByTagName('canvas')[0]; c.width = c.height = 300; var context = c.getContext('2d'); context.font = "20px sans-serif"; context.fillText("212° Fahrenheit", 100, 100);

212 Views
To stop dragend’s default behavior, you need to detect if the mouse is over the drop target where you want to drop.This is what you should do only if you are hovering over my list − listContainer.insertBefore(source, myNode);Use jQuery −if ($(mylist).parent().find(":hover")) { listContainer.insertBefore(source, myNode); }

1K+ Views
A flex container is always the parent and a flex item is always the child. The scope of a flex formatting context is limited to a parent/child relationship. Descendants of a flex container beyond the children are not part of flex layout and will not accept flex properties. There are certain flex properties that apply only to flex containers − justify-content, flex-wrap andflex-direction There are certain flex properties that apply only to flex items” align-self flex-grow flex Always apply display: flex or display: inline-flex to a parent in order to apply flex properties to the child. Let ... Read More

835 Views
To scale fonts, let us see an example.Canvas: 800px Font Size: 60pxYou need to use the following code for our example to scale font size based on canvas −var fontBase = 800; var fontSize = 60; function getFont() { var ratio = fontSize / fontBase; var cSize = canvas.width * ratio; return (cSize |0) + 'px sans-serif'; }

121 Views
Use the ember-localstorage adapter.App.store = DS.Store.create({ revision: 11, adapter: DS.LSAdapter.create() });ExampleYou need to define the adapter you want to use for client-side storage −App.Store = DS.SyncStore.extend({ revision: 10, adapter: DS.IndexedDB.adapter({ mappings: { person: App.Person, persons: App.Person, contact: App.Contact, contacts: App.Contact } }) });

486 Views
While logging in i.e. online, you need to first authenticate against the server and if it works, store the username and a hashed password in the database.If you can find the account in the database, then you need to generate a new hash, only if the user has changed the password since the last time he logged.You need to also authenticate against the local database. Log in using the online version of the app at least once.