DefinitionA pop up element, controlled by css and javascript, used to display additional content on a page. UsageWhile the K2 Pop-up components can be used anywhere, they should be used prudently. Since these objects are controlled by javascript, not all users will be able to access the pop-up items. The following tips will enable you to correctly use the K2 component while still making your site accessible.
How it worksThe K2 pop-ups are controlled solely by javascript contained in the global sniff.js file. They use unobtrusive javascript to add the mouse events to both the triggering object and the pop up object. This works by using multiple class names in your objects to tell the sniff.js file what you want to do. In a K2 pop up there are 2-3 objects to consider. The simplest construct contains two objects; a triggering object (e.g. a link) and the pop-up object (a K2 component). This link is an example of the simplest possible K2 pop-up. The triggering object used here is a link, it contains a blank href set to "#," however it could link to another page. The important part of the link is the class values. With CSS it is possible to list several space delineated class names for any given object. For this link we are using class="k2over unique_id_0". The class name "k2over" is a key word that tells the sniff.js file that we want to add the onmouseover event to this link. Then we add a space, then another class. This class is the same name as the ID of our pop up object. In this example, it is "unique_id_0." This tells the sniff.js that onmouseover we want to open the pop up component containing the ID unique_id_0. The link code looks like... <a href="{placeholder}" class="k2over unique_id_0">This link</a>
The K2 component code looks like...
<!-- BEGIN K2 COMPONENT V.0 --> <div class="k2 k2v0" id="unique_id_0"> <div class="k2w1"><div class="k2w2"> <p> this has a border and no margins to show the pop up object's real dimesions and x/y origin. </p> </div></div> </div> <!-- END K2 COMPONENT V.0 --> You may notice that on the first link, the pop up appears in a weird position. To fix this, we add additional class names to our triggering object to tell the sniff.js where we want the pop up object to be positioned. By default, pop ups are placed with their top/left origin at the same top/left origin of the triggering object. We can offset that position manually using the extra classes' x# or y#, where # is a whole number (negative or positive). Here is an example of that link The link code now looks like this...<a href="{placeholder}" class="k2over unique_id_0 x100 y-50">that link</a>
To improve this, we've moved the pop up over using x100 and up using y-50, but there is even a better way. (Note that in this example we are still refering to the K2 with the "unique_id_0" ID. This shows how you can call the same pop up object with several different triggering objects. To get the position we really want, there are some other class names we can add to our trigger. The first is horizontal keywords "hLeft", "hMiddleLeft", "hMiddle", "hMiddleRight", and "hRight". These position the pop up object in various places along the X axis relative to the triggering object. Below is an example of "hRight" in use, see the list further down for a sample of all the keywords. This is a link with hRight<a href="{placeholder}" class="k2over unique_id_0 hRight">This is a link with hRight</a>
The other set of keywords are for vertical positioning. These keywords are "vTop", "vMiddle", and "vBottom". These position the pop up object in various places along the Y axis relative to the triggering object. Below is an example of "vMiddle" in use, see the list further down for a sample of all the keywords. This is a link with vMiddle
<a href="{placeholder}" class="k2over unique_id_0 vMiddle">This is a link with vMiddle</a>
Now we use both keywords to get the position we want. This is a link with vMiddle hRight
<a href="{placeholder}" class="k2over unique_id_0 vMiddle hRight">in a link</a>
Here's a sample of all the positioning keywords available... No KeywordsDefaultVertical KeywordsvTopvMiddle vBottom Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight "vTop" with Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight "vMiddle" with Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight "vBottom" with Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight Of course, in addition to using keywords, exact placement can be achieved by using x# or y# in addtion to keywords. This is a link with vBottom hLeft y-90 x80
<a href="{placeholder}" class="k2over unique_id_0 vBottom hLeft y-90 x80">
This is a link with vBottom hLeft y-90 x80
</a>
As mentioned above there is a 3rd object than can be considered with this javascript, which we'll call the positioning object. When this object is used, the pop up object is positioned using the x/y origin of this object instead of the triggering object. To use a positioning object you must add the ID of that object to the list of classes in your triggering object. Instead of that ID being it's own class name it is hyphenated with the pop up objects ID name, like this: This will open the pop up with an ID of "unique_id_0" in the default position of the grey DIV below that has an ID of "someID".<a href="{placeholder}" class="k2over someID-unique_id_0">This will open</a>...
the div that contains this content and is colored grey and has an ID attribute set to "someID" No KeywordsDefaultVertical KeywordsvTopvMiddle vBottom Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight "vTop" with Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight "vMiddle" with Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight "vBottom" with Horizontal KeywordshLefthMiddleLeft hMiddle hMiddleRight hRight but wait, there's more!One nice thing is that we can apply these classes to just about any HTML tag. For example... some bold text <b class="k2over unique_id_0 vMiddle hRight">some bold text</b> text w/ span tag <span style="color:#f00" class="k2over unique_id_0 vMiddle hRight">text w/ span tag</span> this has a border and no margins to show the pop up object's real dimesions and x/y origin. Used to show tips or extra info on a highlighted object. Content should be limited to simple HTML such as paragraphs with an optional H5 title. This pop up should not contain links, but instead just provide extra information for the user.
link example
Lorem ColsumTherem olestis a loren rolnes latud hularu. Ingeso ladores es momo lorem drooda. This variation is perfect for showing more information about an object like a video thumbnail while also providing a link for the user to act on. Although there is a link in this variation, the triggering object should also be a link to the same action to allow access to those without javascript.
link example
Wonder TwinsLearn how to use your powers to become a bird or a bucket of water. Plus tips on taking care of your alien monkey.
Used when the activating links are near the right sides of the page. Simply add the class "aboveleft" to the K2's outer DIV.
link example
Wonder TwinsLearn how to use your powers to become a bird or a bucket of water. Plus tips on taking care of your alien monkey. PurposeThe Teleweb K02 allows page owners to present Teleweb to the user in context - rather than simply as a disconnected option in the right hand sidebar. It should be used to embed Teleweb into content where there is an explicit sales call to action - for example, where the user is asked to 'talk with Sun' or 'talk with a Sun sales representative' in relation to a specific offer. The K02 can be used in conjunction with the standard Teleweb widget (both on the same page) - plus it can be used to extend Teleweb support to specific offers on pages where the widget is not deployed because the bulk of the page content is too general, not sales-specific, or not supported by Teleweb. Restrictions
This variation is like variation 0, but places the pop up above the item. This is useful when there are several triggering objects in a row, so the pop up doesn't hide the other elements. This example illustrates the use of a UL instead of a paragraph for the pop up's content. This example also illustrates a list, but adds the use of the "icons" class to the UL tag as well as various icon classes to the LI tags. The icons used here are designed to indicate or signal something about the list items, and should be used along with the g31 component to indicate what the various icons represent. These icons should NOT be used solely for a stylistic purpose. Add the "k2icon" class to any k2 link to get this treatment. This variation is for use on the home page of www.sun sites ONLY. It is not designed for use on any other page or context. To use this component, insert it on the page following the A5 homepage footer, and insert This component is a blank element that uses an ajax call to populate the element when the user clicks on the "poweredby" DIV in the footer. So, in addition to the component code in the light grey box below, you must have a file somewhere on the same file system that has the content of the pop up. The code of that pop up should be constructed with the code in the "POP UP FILE CODE" box on the right. POP UP FILE CODEThis variation is perfect for showing more information about an object while also providing a link for the user to act on. Although there is a link in this variation, the triggering object should also be a link to the same action to allow access to those without javascript. Additional links are acceptable if they also exist on the targeted page. This variation shoule be used instead of variation 1 only when the pop up content contains a bit more content then the variation 1 can fit. Use of the H5 title is optional.
link example
Optional TitleLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. exercitation ullamco laboris Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor enim ad minim veniam, quis nostrud exercitation ullamco laboris This example simply adds the "altv4" class to the outer div. Adding this class removes the pointer arrow on the bottom of the pop up bubble.
link example
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. exercitation ullamco laboris Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor enim ad minim veniam, quis nostrud exercitation ullamco laboris Use when a larger helper pop up is needed, the H5 title is optional.
link example
Lorem ipsumLorem ipsum dolor sit amet, conseciusmod tempor incididunt ut labore et dolore magna aliqua. exercitation ullamco laboris Sed do eiusmod tempor enim ad minim veniam, quis nostrud exercitation ullamco laboris |