Introduction to jQuery-Tools-overlay

Source: Internet
Author: User

Copy codeThe Code is as follows: <! DOCTYPE html>
<Html>
<Head>
<Title> jQuery Tools standalone demo </title>
<! -- Include the Tools -->
<Script src = "http://cdn.jquerytools.org/1.2.7/full/jquery.tools.min.js"> </script>
<! -- Standalone page styling (can be removed) -->
<Link rel = "stylesheet" type = "text/css"
Href = "./overlay-basic.css"/>
<Style>
/* Some styling for triggers */
# Triggers {
Text-align: center;
}
# Triggers img {
Cursor: pointer;
Margin: 0 5px;
Background-color: # fff;
Border: 1px solid # ccc;
Padding: 2px;
-Moz-border-radius: 4px;
-Webkit-border-radius: 4px;
}
/* Styling for elements inside overlay */
. Details {
Position: absolute;
Top: 15px;
Right: 15px;
Font-size: 11px;
Color: # fff;
Width: 150px;
}
. Details h3 {
Color: # aba;
Font-size: 15px;
}
</Style>
</Head>
<Body> <! -- Trigger elements -->
<Div id = "triggers">


</Div>
<! -- Overlays -->
<Div class = "simple_overlay" id = "mies1">

<Div class = "details">
<H3> The Barcelona Pavilion <H4> Barcelona, Spain <P>
The Barcelona Pavilion, designed by Ludwig Mies van der Rohe,
Was the German Pavilion for the 1929 International Exposition in
Barcelona, Spain. It was an important building in the history
Modern architecture.
</P>
<P>
Several critics, historians and modernists have declared it"
Most beautiful building of the century"
</P>
</Div>
</Div>
<Div class = "simple_overlay" id = "mies2">

<Div class = "details">
<H3> The Barcelona Pavilion <H4> Barcelona, Spain <P>
Another unique feature of this building is the <em> exotic
Materials Mies chose to use </em>.
</P>
<P>
Plates of high-grade stone materials like veneers of Tinos verde
Antico marble and golden onyx as well as tinted glass of gray,
Green, white, in addition to translucent glass, perform
Exclusively as spatial dividers.
</P>
</Div>
</Div>
<Script>
$ (Document). ready (function (){
$ ("Img [rel]"). overlay ({
CloseOnClick: false,
Mask: 'darkred'
});
});
</Script>
</Body>
</Html>

CSSCopy codeThe Code is as follows:/* the overlayed element */
. Simple_overlay {
/* Must be initially hidden */
Display: none;
/* Place overlay on top of other elements */
Z-index: 10000;
/* Styling */
Background-color: #333;
Width: 675px;
Min-height: 200px;
Border: 1px solid #666;
/* CSS3 styling for latest browsers */
-Moz-box-shadow: 0 0 90px 5px #000;
-Webkit-box-shadow: 0 0 90px #000;
}
/* Close button positioned on upper right corner */
. Simple_overlay. close {
Background-image: url (./close.png );
Position: absolute;
Right:-15px;
Top:-15px;
Cursor: pointer;
Height: 35px;
Width: 35px;
}

Name of the closed css: xxx. close
Sex
All available attribute options are listed below:

Attribute Default Value Description
Close Overlay the ending element in a jQuery selector. These can be any element, such as links, buttons, or images. If this is not provided, intimate elements are automatically generated. Read more about this in defining the close action.
CloseOnClick true By default, the overlap is when the mouse is closed or the area is clicked. Applicable to the modal dialog box.
CloseOnEsc true By default, the ESC key is disabled when the network is overwritten.
Effect 'default'

Use the open package to disable the effect. This can dramatically change the behavior superposition. By default, this tool uses 'default', which is a simple display/hide effect.

The following lists the available effects you can also make yourself.

Fixed true Since 1.2.0. The screen is scrolled while the screen remains in the same coverage position. This is suitable for all browsers by default except IE6 and below. IE6 does not support fixed positions. If this attribute is set to false Then it is positioned in the overwriting relation to the document so as to scroll on the screen and move together with the document.
Mask Previously calledExposure. This mask tool is often used in combination with coverage. In this way, embedded tools support this feature. This option accepts the mask configuration. This is not a simple string that specifies the background color of the mask or more complex object text to specify more configuration variables.

An example is superimposed with a mask. By default, blocking is disabled.

Left "Center" Specify how far to overlay the screen from the edge of the left. By default, the value of the horizontal package set is "center", but you can also provide a distance specified by the value in pixels.
Load False Since 1.2.0. If the overwritten load is enabled, it is initialized immediately.
OneInstance true By default, only one page can be superimposed. Set this attributeFalseYou can have multiple overlapping instances.
Speed 'Normal' The 'normal' effect of the fade-in speed animation. The valid values are 'low', 'normal', and 'save'. Alternatively, you can provide a value (in milliseconds ). By setting this attribute to 0, the scroll will appear immediately without any animation.
Target Specified in the calendar element (if notRelAttribute trigger element ).
Top '123' Specifies how to move away from the overlay of the top edge of the screen. An acceptable value is an integer that specifies a distance (in pixels) and a string (such as "15% ") specify the percentage value or "center". In this case, the superposition is vertical center. The percentage remains at different screen resolutions.

Event
Make sure you have read about the event jQuery tool. All Event Listeners receive this event object as the first parameter and no other parameters are superimposed.

Event When did it happen?
OnBeforeLoad Before overlapping display. Overlay the animation from where it is located.
Onload When the overlay is completely displayed
OnBeforeClose Close previous Overlays
OnClose When overlay is disabled

Script API
First, make sure you understand yourself and the jQuery tool script. The following lists all available API methods:

Method Return Value Type Description
Close () Overlay Close overlay.
GetClosers () jQuery Returns the end element (s) as a jQuery object.
GetConf () Object Overlay the configuration.
GetOverlay () jQuery The returned element is used as a jQuery object calendar.
GetTrigger () jQuery The returned element is triggered as a jQuery object.
IsOpened () Boolean ReturnRealIf the package is opened.
Load () Overlay Enable superposition.

I will draw a sentence for the updated time tomorrow.

Tab: Portal
Tab (slide): Portal
Tooltip: Portal
Overlay: Portal
Dateinput: Portal
I did framework2.0 at Ctrip, but I studied framework4.0. What I thought at that time was T.T. It's all about TMD's old technology and heap code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.