Articles with tag 'Unobtrusive JavaScript-'


Shadowbox 3.0 beta

It was released just now (thanks to the suggestion of the author Michael JI Jackson ) the 3.0 beta release of Shadowbox.js . In addition to the new design of the website here are the most important changes in this release preliminary:

Continued ...

Simple Accordion with the class USimpleTabStrip

The class USimpleTabStrip , presented in Unobtrusive Simple TabStrip , can also be used to realize a simple menu Accordion .
offerti da Scriptaculous : Using the effects of BlindUp() and BlindDown() offered by Scriptaculous :

1
2
3
4
5
6
7
8
9
10
function init () {
USimpleTabStrip ( ) ; USimpleTabStrip uts = new ();
; uts. Init ();
function ( e ) { uts. onShow = function (e) {
( e ) ; new Effect. BlindDown (e);
}
function ( e ) { uts. OnHide = function (e) {
( e ) ; new Effect. BlindUp (e);
}
}

And repositioning HTML elements ( HTML source ):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"accordion" > < div class = "accordion">
"#acc1" > Accordion 1 < / a > < a href = "# acc1"> Accordion 1 </ a >
"acc1" >< / a > < a name = "acc1"> </ a >
< div >
h1 > < h1 > Content # 1 </ h1 >
p > < p > Blah blah blah .... </ p >
</ div >

"#acc2" > Accordion 2 < / a > < a href = "# acc2"> Accordion 2 </ a >
"acc2" >< / a > < a name = "acc2"> </ a >
< div >
h1 > < h1 > Content # 2 </ h1 >
p > < p > Blah blah blah .... </ p >
</ div >

"#acc3" > Accordion 3 < / a > < a href = "# acc3"> Accordion 3 </ a >
"acc3" >< / a > < a name = "acc3"> </ a >
< div >
h1 > < h1 > Content # 3 </ h1 >
p > < p > Blah blah blah .... </ p >
</ div >

</ div >

You get a simple Accordion menu that can be used in an extremely rapid way.

Continued ...

Unobtrusive Simple TabStrip

USimpleTabStrip is an unobtrusive JavaScript can improve the classic anchor link (still) within a HTML page. This source is an improvement of the function presented in Unobtrusive Tabstrip . In this version also align the code to release 1.6 of prototype.js was created a real class to handle the TabStrip. The release presented here is very simple and straightforward. His main work lies in adding a click event to the normal link anchor. They are also not presented CSS styles, just to allow maximum freedom of action, but you can get an effective TabStrip with a few lines of CSS code additional, see Add CSS styles below.

HTML

The class USimpleTabStrip working on a simple HTML, sftuttando the anchor ( &lt;a name&gt;&lt;/a&gt; ):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<! - Simple list of links in the page ->
< ul >
= "#tbs1" > Link 1 < / a >< / li > < li > < a href = "# tbs1"> Link 1 </ a > </ li >
= "#tbs2" > Link 2 < / a >< / li > < li > < a href = "# Tbs2"> Link 2 </ a > </ li >
= "#tbs3" > Link 3 < / a >< / li > < li > < a href = "# tbs3"> Link 3 </ a > </ li >
</ ul >

<! - Blocks / tabs ->

"tbs1" >< / a > < a name = "tbs1"> </ a >
< div >
h1 > < h1 > Listing # 1 </ h1 >
p > < p > Blah blah blah .... </ p >
</ div >

"tbs2" >< / a > < a name = "Tbs2"> </ a >
< div >
h1 > < h1 > Listing # 2 </ h1 >
p > < p > Blah blah blah .... </ p >
</ div >

"tbs3" >< / a > < a name = "tbs3"> </ a >
< div >
h1 > < h1 > Card # 3 </ h1 >
p > < p > Blah blah blah .... </ p >
</ div >

funziona da contenitore. The tag div just below the anchor a work as a container.

Continued ...

Text Replacement Techniques in Flash

The Text Replacement technique that I present today is, in some respects, really interesting. Unlike the classical replacement is to image via CSS , this technique uses a Flash movie to overwrite the titles of our site. Despite being a little more articulated, as it requires the creation of a Flash movie and the use of Javascript, allows to obtain a number of considerable advantages:

  • Keeps the 'accessibility of the site by exploiting a -True-Unobtrusive Javascript so that web crawlers and spiders continue to see the page as simple and correct HTML
  • It does not require the creation of n images for n stocks. It only takes one movie to replace all the titles of our site, with a considerable saving in terms of Download
  • Allows you to create simple but also titles with Font normally not used on the Web
  • The text can be rendered in HTML, thanks to the characteristics of Flash
  • The text is selectable
  • Being a Flash movie you can put any kind of interactivity and animations

You'll notice, too, that in this procedure the CSS are hardly taken into account!

Continued ...

Shadowbox assetURL: Set the image path

When Shadowbox opens his window to show content (image, iframe, Movie, etc ...), view, waiting, an animated gif that comes in the package. If the page that is using Shadowbox is at the same level as the images folder, everything works fine. By default, in fact, look for the animated gif below Shadowbox images / loading.gif - or images / loading-light.gif if you have chosen the styles light (shadowbox-light.css). Otherwise, and often there is also the risk of not accorgesene, if we are in a different masts, it generates a nice code 404 - page not girder in our case file not found!

To solve the problem just initialize Shadowbox with an appropriate parameter that indicates precisely the absolute path to the images folder: undolog.com of, for example, I placed the animated gif of loading directly into the images folder in this root (how about a billion other sites :) . To make this folder accessible to Shadowbox, regardless of the path, I have included an easy way:

1
2
/ / Init parameter shadowbox with assetURL
assetURL : 'http://www.undolog.com/' } ) ; Shadowbox. Init ({assetURL: 'http://www.undolog.com/'});

Continued ...

All clones Lightbox in a dynamic array

Planetozh has created a beautiful scenery of the dynamic tool can list all the JavaScript libraries like Lightbox.

image

image Using a panel (see image at left) with a series of "ticks" (checkbox), which indicate the various features of the libraries, you can run a filter resulting in a list of one or more libraries that do the job. We hope that the author maintains updated this fantastic page, very useful in disentangle the numerous and ever more powerful libraries of this kind.

Continued ...

Unobtrusive SWFObject 2.0

swfobject SWFObject is a JavaScript script used to insert Flash content within the pages of the Web Its main function is to eliminate the need for activation of control by the Microsoft Internet Explorer (which, by the way, is being discontinued operations - see here ) and, most interestingly, the ability to automatically check for and install Flash Player if required. SWFObject can be considered a good alternative to the kit install / detect supplied by Adobe itself, and that can be generated from within the IDE Flash (in all its versions). With version 2.0 , SWFObject improves its performance and its use. As indicated on the official documentation , moved to Google Code, the news of this release are so many as to make it NOT compatible with previous versions. This results in fact in a complete overhaul of the code for those who decide to upgrade a previous version of the SWFObject 2.0.

The script is now aligned to the latest standard, both syntactically and from that "non-intrusive". Supports all previous features, such as quick installation of the Flash Player, with a code clearer and easier to use. The passage of the parameters, for example, from Javascript to Flash Player (and thus to our movie) is now much clearer and more versatile. Were also introduced two main operating modes: static and dynamic, depending on the page type and design process that we are performing.

Helpful and really made ​​bon is the online tool that generates code SWFObject for us.

LINK:

Continued ...

Effect.Tween Scriptaculous: How It Works

Among all the libraries "web 2.0" available, scriptaculous is certainly the most poorly documented! On the official website, often slow, the documentation is partial, poorly made ​​and difficult to use. With the latest releases, then, some new features are completely missing, just as the new core effect Tween (Effect.Tween). The latter, in a manner similar to Tween Flash, allows to manipulate custom transitions. SYNOPSIS its base is the following:

Continued ...

Light Gallery: LightView 2.0.0_rc1

LightView Newly released here's yet another Unobtrusive Javascript library for image galleries and more. LightView in 2.0.0_rc1 release , also adds functions to "open" the Window with content that goes beyond simple image: Flash movies, QuickTime , Form and IFRAME! Compared to the previous version (1.1.0 - which handles only images), therefore, this release candidate is enriched by the features present in other libraries . . The tools required by Lighview to work are very well known Prototype 1.6.0.2 and Scriptaculous 1.8.1 . Gliattributi are used to manage the library class and rel .

Interesting one aspect of this library is the extreme care with which the graphic appears.

Rating: 9 - Homepage of LightView

Continued ...

Light Library: from Slimbox to Shadowbox, galleries in Javascript

Some might say - and rightly so - just! Of Javascript libraries (Unobtrusive - not intrusive, or partially) to handle images and galleries there are so many. Anyway here is the list, with strengths and weaknesses, the best I've tried.

SlimBox 1:41

Extremely minimal, 7K (to 1.41), requires mootools to work. As shown on the Home page is a true clone graph Lightbox , which we will see below. Honestly, apart from the extreme compactness of the library, nothing peculiar. On the same site, however, you can find there also a script to generate runtime reflection ... it may be useful to limit this ;)

Rating: -6 - Home Page Slimbox, Home Reflection.js for MooTools

Lightbox2

Lightbox2 One of the most well-known and simple. Manages in this release are images (so it does not work with QuickTime, Flash or other). For its operation requires Prototype and Scriptaculous . Use the attribute rel to identify the links of the images to be processed:

1
"images/image-1.jpg" rel = "lightbox" title = "my caption" > image #1 < / a > < a href = "images/image-1.jpg" rel = "lightbox" title = "my caption"> image # 1 </ a >

Like other libraries that we will see, supports the slideshow mode, by entering any identifier in square brackets in a number of link / image:

1
2
3
"images/image-1.jpg" rel = "lightbox[roadtrip]" > image #1 < / a > < a href = "images/image-1.jpg" rel = "lightbox [roadtrip]"> image # 1 </ a >
"images/image-2.jpg" rel = "lightbox[roadtrip]" > image #2 < / a > < a href = "images/image-2.jpg" rel = "lightbox [roadtrip]"> image # 2 </ a >
"images/image-3.jpg" rel = "lightbox[roadtrip]" > image #3 < / a > < a href = "images/image-3.jpg" rel = "lightbox [roadtrip]"> image # 3 </ a >

Rating: 6 - Home Page Lightbox2

LIGHTWINDOW 2.0

LightWindow 2.0 Again, this is quite common! After all how to understand what is the most used? ;) . However it is extremely comprehensive and versatile. The site stands out the call for donations for the purchase of a Mac ... a little invasive and pressing ... However, like the previous one, for its operation, requires the presence of Prototype and Scriptaculous . Unlike its predecessor, however, this allows you to view moltisiimi file types: from the images, QuickTime movies, Flash movies, external HTML pages and PDF files. ) altri obbligatori ( class e params - per impostare il comportamento della libreria). Conversely, uses various attributes, some optional ( author, caption and title ) other mandatory ( class and params - to set the behavior of the library). For example, to display a gallery or slideshow will use the attribute rel :

1
2
3
"gallery/0-sushi.jpg" class = "lightwindow" rel = "[Sushi]" title = "Left Behind" caption = "Look's super tasty!" author = "Unknown" > image #1 < / a > < a href = "gallery/0-sushi.jpg" class = "lightwindow" rel = "[Sushi]" title = "Left Behind" caption = "Look's super tasty!" author = "Unknown"> image # 1 </ to >
"gallery/1-sushi.jpg" class = "lightwindow" rel = "[Sushi]" title = "Beware of warewolves..." caption = "I shouldn't be doing this when I am hungry" author = "Unknown" > image #2 < / a > < a href = "gallery/1-sushi.jpg" class = "lightwindow" rel = "[Sushi]" title = "Beware of warewolves ..." caption = "I Should not be doing this when i am hungry" author = "Unknown"> image # 2 </ a >
"gallery/2-sushi.jpg" class = "lightwindow" rel = "[Sushi]" title = "That was good!" caption = "Take that sushi!" author = "Unknown" > image #3 < / a > < a href = "gallery/2-sushi.jpg" class = "lightwindow" rel = "[Sushi]" title = "That was good!" caption = "Take that sushi!" author = "Unknown"> image # 3 </ a >

Rating: 8 - Home Page LightWindow 2.0

Shadowbox 1.0B

Shadowbox Despite both to version 1.0 beta, this is perhaps the most complete library, both from functional point of view for both libraries supported. For its operation, in fact, you can choose from a number of frameworks, thanks to files "adapter" specially made and provided by the author:

The visual effect (configurable via skin / css), then, unlike the others, it is definitely more appealing. The attributes are used only rel where, in its interior, find space all other configuration parameters. For example, to achieve a gallery, just use:

1
2
"beach.jpg" rel = "prettyPhoto[Vacation]" > The Beach < / a > < a href = "beach.jpg" rel = "prettyphoto [Vacation]"> The Beach </ a >
"pier.jpg" rel = "prettyPhoto[Vacation]" > The Pier < / a > < a href = "pier.jpg" rel = "prettyphoto [Vacation]"> The Pier </ a >

If you want to set some options ( see website for full list ) just use the following syntax:

1
"myimage.jpg" rel = "prettyPhoto;options={overlayOpacity: 0.5, resize: false}" > My Image < / a > < a href = "myimage.jpg" rel = "prettyphoto, options = {OverlayOpacity: 0.5, resize: false}"> My Image </ a >

On the Internet if they can find also other, such as Highslide JS . Indeed, if some other library you want to report me ... Anyway, personally, I prefer Shadowbox for simplicity, scalability, and cross-framework.

Rating: 9 - Home Page Shadowbox 1.0B

Continued ...