AJAX
  Home arrow AJAX arrow Page 2 - Using Prototip
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
AJAX

Using Prototip
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 5
    2009-01-28


    Table of Contents:
  • Using Prototip
  • Basic Implementation
  • The Style Sheet
  • Improving the Configuration

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Using Prototip - Basic Implementation
    ( Page 2 of 4 )

    Now that we're ready to put Prototip to use, let's make a basic example page that has some images on it which will produce the tooltips when they are hovered over -- something like the following screen shot:

     

     

    In a new page in your text editor start with the following code:

     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <html>

    <head>

    <link rel="stylesheet" type="text/css" href="../css/prototip.css">

    <link rel="stylesheet" type="text/css" href="../css/mytips.css">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <title>Prototip Example</title>

    </head>

    <body>

    <div id="container">

    <label>Option 1</label><select><option>Choose an Option</option></select><a class="tip" id="help1" href="#" title="Help for option 1"></a>

    <label>Option 2</label><select><option>Choose an Option</option></select><a class="tip" id="help2" href="#" title="Help for option 2"></a>

    <label>Option 3</label><select><option>Choose an Option</option></select><a class="tip" id="help3" href="#" title="Help for option 3"></a>

    <label>Option 4</label><select><option>Choose an Option</option></select><a class="tip" id="help4" href="#" title="Help for option 4"></a>

    <label>Option 5</label><select><option>Choose an Option</option></select><a class="tip" id="help5" href="#" title="Help for option 5"></a>

    </div>

    <script type="text/javascript" src="../scriptaculous-js-1.8.2/lib/prototype.js"></script>

    <script type="text/javascript" src="../scriptaculous-js-1.8.2/src/effects.js"></script>

    <script type="text/javascript" src="../js/prototip.js"></script>

    </body>

    </html>

     

    Save this as  prototip1.html   in your  pages   folder. It is essential that pages which use the Prototip plugin are placed in a folder at the same directory level as the images folder. This is because some of the elements that make up the tooltips have style attributes written to them when they are dynamically created by the plugin.  

    Our page contains the elements making up our test form; the labels, selects and the links that we're going to use as the tooltip triggers. Each link has several attributes, including a title for use in situations where JavaScript is disabled. This is an important aspect of progressive enhancement, in which we define an inner core of base content, then where possible extend it. Following this we link to the Prototype, Scriptaculous and Prototip script files. 



     
     
    >>> More AJAX Articles          >>> More By Dan Wellman
     

       

    AJAX ARTICLES

    - PHP AJAX Form Validation
    - Completing a User-Defined CSS Website with P...
    - Create a User-Defined CSS Website with PHP
    - Build A Better Twitter Chat Client Than Cham...
    - Using Division Equations to Make Web Forms S...
    - Using Integer Multiplication to Protect Web ...
    - Using Simple Checksums for Web Form Verifica...
    - Protecting Web Forms with AJAX
    - Using Prototip with AJAX
    - Using Prototip
    - Using the google.load() Method with Google`s...
    - How to Handle Ajax Errors
    - Uncompressing Source Files with Google`s AJA...
    - Using the jQuery Framework with Google`s Aja...
    - Using Google`s Ajax Libraries API




    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek