background preloader

How to build a web widget (using jQuery) - Alex Marandon

How to build a web widget (using jQuery) - Alex Marandon
Published on 15 June 2010, updated on 10 February 2015, 110 Comments Introduction I created some web widgets for the London’s Design Museum and learned a few useful things in the process. Although all the necessary information can be found on the web, I couldn’t find a really comprehensive guide about doing this with jQuery so I decided to write this one. I’ll cover only techniques which are specific to web widgets so you should already be familiar with JavaScript, jQuery and web development if you want to follow easily. The interesting points will be: ensure the widget’s code doesn’t accidentally mess up with the rest of the page, dynamically load external CSS and JavaScript files, bypass browsers’ single-origin policy using JSONP. Don’t worry if all this doesn’t make sense to you yet, we’ll see in details what these techniques are used for in the context of building web widgets. That’s really all that a web site owner would need to include our widget on her pages. Can’t it be even simpler? Related:  web

Building JavaScript Widgets | dtsn Little pieces of JavaScript you embed onto your website are getting more popular. Every major provider of a service on the web also gives you a little widget that you can put on your blog or webpage to promote what you are doing, for example Twitter, Last FM and Digg all provide widgets which are great for you and great for the service. I am going to talk you through the development and pitfalls associated with the design and development of widgets. First and foremost, you need to decide what you want to show with your widget. IFrame’s No, iframe’s aren’t dead. document.write('<iframe src=" width="50" height="50"></iframe>'); To install the widget all you have to do is to point the user at your bit of JavaScript: You can pass any variables you want through to the user at this point by simply making them JavaScript variables, and using the JavaScript to build up the iframe URL based on these variables. That's it! Client Side Pitfalls AJAX won’t work!

Mind Map A mind map is a kind of spider diagram that organizes information around a central concept, with connecting branches. The layout is controlled by moving the nodes closest to the tree's root node. When one of these nodes is moved horizontally to the other side of the root, all of its children will be sent to Layout.doLayout with a new direction, causing text to always be moved outwards from the root. The spotConverter function is used to manage GraphObject.fromSpot and GraphObject.toSpot for nodes manually, so the TreeLayout.setsPortSpot and TreeLayout.setsChildPortSpot properties are set to false so that laying out the diagram will not overwrite the values. When a node is deleted the CommandHandler.deletesTree property ensures that all of its children are deleted with it. Node templates also have a Part.selectionAdornmentTemplate defined to allow for new nodes to be created and a GraphObject.contextMenu with additional commands. Diagram Model saved in JSON format:

Zoomooz.js Zoomooz is: 6KB gzipped and 18KB minified. This includes everything but jQuery. Make any web page zoom. Latest version: 1.1.9 (Nov 11, 2013, hacky fix for the back and forward buttons #66) Zoomooz is a jQuery plugin for making web page elements zoom. It can be used for making Prezi like slideshows and for zooming to images or other details. Quirky transformations You can zoom to elements that have been translated, scaled and skewed, and they will morph correctly. Try by clicking on these: Skew Scale Rotate There is some interesting stuff happening in the background to make the morphings work. Adding Zoomooz to your web page Just add this to your web page head and you should be up and running with Zoomooz: The easy way to zoom Simply add "zoomTarget" to the element you want to zoom to when clicked on: <div class="zoomTarget">This element zooms when clicked on. You can also add some additional attributes for tuning the animation as data fields of the element: Here is a demo, click on the elements: Demos

NoFlo | Flow-Based Programming for JavaScript Farbtastic Color Picker Basic Usage Include farbtastic.js and farbtastic.css in your HTML:<script type="text/javascript" src="farbtastic.js"></script> <link rel="stylesheet" href="farbtastic.css" type="text/css" /> Add a placeholder div and a text field to your HTML, and give each an ID:<form><input type="text" id="color" name="color" value="#123456" /></form> <div id="colorpicker"></div> Add a ready() handler to the document which initializes the color picker and link it to the text field with the following syntax:<script type="text/javascript"> $(document).ready(function() { $('#colorpicker').farbtastic('#color'); }); </script> See demo1.html and demo2.html for an example (jquery.js is not included!). Styling The color picker is a block-level element and is 195x195 pixels large. You can control the position by styling your placeholder (e.g. floating it). Note that the black/white gradients inside wheel.png and mask.png were generated programmatically and cannot be recreated easily in an image editing program.

Hack our apps | Meemoo project by Forrest Oliphant welcome to meemooVilson Vieira Paper GIFforresto GIF+HTML workshopBrasstown animators HTML5 videoForrest Oliphant particles → trailsForrest Oliphant (more) particles → tileForrest Oliphant Megacam gridForrest Oliphant GIFs from 1989Forrest Oliphant recursive spiralForrest Oliphant hackable clock 0.1Forrest Oliphant digital rainbow clockForrest Oliphant play beethovenVilson Vieira, g200kg 8 bit synthVilson Vieira, g200kg mr.doob harmonyVilson Vieira, mr.doob web tunnelVilson Vieira Play Audio in the Background Using HTML5 Audio | World Wide What? Posted on August 8th, 2011 in category: Tutorials On of the most interesting new features of HTML5 is the audio support, it allows you to easily play audio using native HTML. This can be very useful for media focused sites but also for just playing simple alert messages from JavaScript when showing dialogs or to notify the user of certain events. A common misunderstanding for users new to HTML5 is that you need the audio HTML tag to be able to play audio. Step 1. We start of by creating a simple HTML page with four links, one for each playable sound. Step 2. Next we create a script tag inside our page header and add a play function to it. The play function accepts the name of the audio file we want to play as a parameter. Since different browsers support different audio formats we need to have both mp3′s and ogg versions of our alerts to suppot as many browsers as possible. Note You can convert your audio files to both ogg and mp3 format using my new audio converter. Example Download

noflo/noflo: Flow-based programming for JavaScript noflo/noflo-ui: NoFlo Development Environment

Related: