JavaScript
  Home arrow JavaScript arrow Creating Pop-up Notes with CSS and JavaScr...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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? 
JAVASCRIPT

Creating Pop-up Notes with CSS and JavaScript Part II
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 24
    2005-01-24

    Table of Contents:
  • Creating Pop-up Notes with CSS and JavaScript Part II
  • The HTML markup
  • The complete code
  • Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb 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


    Creating Pop-up Notes with CSS and JavaScript Part II


    (Page 1 of 4 )

    A pop-up note contains information and can be made to appear when a visitor to your website moves the mouse over the appropriate area. In our second of two articles about pop-up notes, Alejandro Gervasio explains how to create multiple pop-up notes on a Web page using CSS and JavaScript.

     

    Creating multiple pop-up notes

    Once we’ve taken an in-depth look at our previous example, it’s easy to generate multiple pop-up notes with JavaScript. The basic idea rests on tying each link displaying a note to the corresponding <div> element that includes the pop-up note content. When we set up the relationship between the elements, all we need to do is write the JavaScript code for programmatically manipulating the visual display of the pop-up notes. So, let’s begin defining our CSS code:

    <style type="text/css">

    p {
                font: normal 11px "Verdana", Arial, Helvetica, sans-serif;
                color: #000;
    }

    a.special:link,a.special:visited {
                font: bold 11px "Verdana", Arial, Helvetica, sans-serif;
                color: #00f;
                text-decoration: underline;
    }

    a.special:hover {
                color: #f00;
    }

    .note {
                position: absolute;
                top: 0px;
                left: 0px;
                background: #ffc;
                padding: 10px;
                border: 1px solid #000;
                z-index: 1;
                visibility: hidden;
                font: bold 11px "Verdana", Arial, Helvetica, sans-serif;
                color: #000;
    }

    </style>

    The CSS declarations are almost identical to those corresponding to the single pop-up note. We’ve redefined the <p> tag, for this example, and then we’ve declared the "special" class to get the links a little styled. Finally, we define a class named "note," which will apply the style to all of the pop-up notes present on the Web page. Since all the notes will be hidden from view, they’re absolutely positioned to X-Y coordinates: 0px 0px. Their visibility property is set to "hidden" initially, but, as we know, will be changed accordingly.

    More JavaScript Articles
    More By Alejandro Gervasio


       ·  Here's the second part of the article. We're dealing with creating multiple...
       · I'm confused as to why you've used visibility:hidden; instead of...
       ·  That's right. Visibiliy simply hides the element without removing it from the...
       · The notes stay visible in Safari (1.2.4) when using onmousemove - changing to...
       ·  Yes,I've tried with Firefox, but it doesn't handle properly the event object when a...
       · Error: event is not definedSource File:...
       · Hi,I was unable to acces your provided URL.Alejandro Gervasio
       · As the code is it does not work with Firefox. It did, however, work properly with...
       · Hi Alejandro,Great article. From it, I figured out 2 things:1) simpler way...
       · Hi thereI have tried this with long pages. The pop-up notes work in the top part...
       · Hello,Thank for your comments on this article. With reference to your question,...
       · Hello,Thanks for the comments. Regarding your question, here's a modified...
       · Thank you very much AlejandroI used some bits of your code along with info from...
       · Hello again,Thank you for posting your message. I'm glad to hear that you found...
       · Even with this modified code, I still see the same problem. The pops aren't visible...
       · Thank you for your feedback. I changed the function I posted before, in order to...
       · Hi, I am trying to get multiple pop-up notes to appear when I click on an image...
       · Thanks for commenting on my JavaScript article. Concerning your question, this...
     

    JAVASCRIPT ARTICLES

    - Comparing Fields and Customizing Error Messa...
    - Checking Numbers and File Extensions with jQ...
    - Validating Digits and Dates with jQuery`s Va...
    - Validating Ranges, Emails, and URLs with jQu...
    - More Uses for the jQuery Tooltip Plug-in`s b...
    - Building Image-Based Tooltips with the jQuer...
    - Using the jQuery Tooltip Plug-in`s bodyHandl...
    - Using Rangelength, Min and Max with the Vali...
    - Using Minlength and Maxlength with the Valid...
    - Modifying Tooltip Coordinates with the jQuer...
    - Applying a Fade Out Effect with the jQuery T...
    - Tracking Mouse Movements with the jQuery Too...
    - Checking Online Forms with the Validator jQu...
    - Nested JavaScript Functions as Objects
    - The jQuery Tooltip Plug-in







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