Frameset framework pop-up layer and frameset framework pop-up

Source: Internet
Author: User

Frameset framework pop-up layer and frameset framework pop-up

A message reminder is provided for projects created some time ago. I believe that many Daniel have done this. The following describes the problems and solutions I have encountered.

First, our project uses the frameset framework and main code.

<frameset name="myFrame" cols="85,*" frameborder="no" border="0" framespacing="0">    <frame src="${base}/left.jsp" name="leftFrame" frameborder="no" scrolling="auto" noresize="noresize" id="leftFrame" />        <frame src="${base}/welcome.jsp" name="mainFrame"   frameborder="no" scrolling="auto"  noresize="noresize" id="mainFrame" /></frameset>

This divides the Left and Right Parts.

The message icon must be clicked on any page. A message is displayed in the lower right corner.

I have never done this. At that time, I checked a lot of information. Then find the message plug-in of jquery. Later I found out how to operate the js of the parent framework, and then the problem was solved.

Because left. jsp is the menu navigation. It remains unchanged. So I put the message icon in left.

Js functions on the left. jsp page:

Function openMsg (msgType) {// call the parent form to obtain the message js window. parent. getMessage (msgType );}

This is the js function for Opening messages in left. MsgType indicates the message status.

Window. parent function: return to the parent window

Note: If the window itself is a top-level window, the parent attribute returns a reference to itself.

In the frame webpage, the parent window is usually the top-level window, but if there is a frame in the Framework, the parent window and the top-level window are not necessarily the same.

With this method, we can directly call the getMessage () function of main.

The getMessage () function in main:

Function getMessage (msgType) {/* $. messager. lays (width, height); * This method is mainly used to define the width and height of the pop-up window. */$. Messager. lays (200,150); var msg = "no message" if (msgType = 1) {msg = "jqueryMessage new message reminder ";} else {msg = "jqueryMessage notified message";}/* $. messager. show (title, text, time); * This method mainly defines the content displayed in the window and how long the window will be hidden. * If the default title is used, the title is set to 0, and the title and text can be set to html for display. If you want to click the close button in the pop-up window to close the * message box, you can set the time to 0. */$. Messager. show ("message reminder", msg) ;}</script>

$. Messager. anim (type, speed );

This method mainly defines the mode and speed at which the window is displayed.

$. Messager. anim ("fade", 1000); // displays it in an animated manner of fadeIn.

$. Messager. anim ("show", 1000); // animated display by show

The preceding section briefly describes several common methods of jquery message plug-ins.

Of course, we need to introduce jquery. js and jquery. messager. js files on the page.

With this combination, we have completed the entire set of functions.

 

IE8 runs normally and Google is compatible.

Attaches the entire source code: http://files.cnblogs.com/zhangnanblog/jqueryMessage%E7%A4%BA%E4%BE%8B.rar

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.