Jquery implements top pop-up box effects_jquery
The dynamic pop-up prompt box at the top of the page produced by Jq can be used to display prompt information and notification information.
Html code
<div class="tooltiptop"> <div class="bg"></div> <div class="main"><i>Jq顶部弹出框</i><span onClick="ToolTipTop.Hide();" title="关闭">X</span></div> </div>
Css code
body { margin: 0; padding: 0; } .tooltiptop { width: 100%; height: 50px; margin-top:-50px; display:none; } .tooltiptop .bg { width: 100%; background-color: #333; height: 50px; opacity: .7; position: absolute; margin: 0; } .tooltiptop .main { width: 100%; position: absolute; margin: 0; height: 50px; line-height: 50px; text-align: center; color: #fff; } .tooltiptop .main span { float: right; color: #fff; margin-right: 20px; cursor: pointer; }
Jq code
var ToolTipTop={ Show:function(Msg){ $(".tooltiptop .main i").html(Msg); $(".tooltiptop").css("display","block").animate({marginTop:"0px"},500); }, Hide:function(){ $(".tooltiptop").animate({marginTop:"-50px"},500,function(){$(this).css("display","none")}); } }
Let me share with you another example of special effects, the effect is also very good
CSS
<style type="text/css"> *{margin:0;padding:0;list-style-type:none;} a,img{border:0;} .demo{margin:0 auto 0 auto;padding:200px 0 0 0;width:400px;text-align:center;font-size:18px;} .demo .action{color:#3366cc;text-decoration:none;font-family:"微软雅黑","宋体";} #Header{ position:fixed;z-index:9999999;top:0;right:0;left:0;height:38px;border-bottom:1px solid #e0dede;width:100%; background-color:#F7F7F7; background-image:linear-gradient(#fff, #f7f6f5); background-image:-moz-linear-gradient(#fff, #f7f6f5); background-image:-o-linear-gradient(#fff, #f7f6f5); background-image:-webkit-linear-gradient(#fff, #f7f6f5); box-shadow:inset 0 1px #fff, 0 1px 3px rgba(34,25,25,0.4); -moz-box-shadow:inset 0 1px #fff, 0 1px 2px rgba(34,25,25,0.4); -webkit-box-shadow:inset 0 1px #fff, 0 1px 3px rgba(34,25,25,0.4); } *html,*html body{background-image:url(about:blank);background-attachment:fixed;} *html #Header{position:absolute;top:expression(eval(document.documentElement.scrollTop));} .overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:998;width:100%;height:100%;background:#f6f4f5;display:none;} *html,*html body{background-image:url(about:blank);background-attachment:fixed;} *html .destroy,*html .overlay{position:absolute;top:expression(eval(document.documentElement.scrollTop));} .destroy{position:fixed;top:0px;left:50%;margin-left:-425px;*margin-left:-718px;_margin-left:-425px;margin-top:-292px;z-index:99996;opacity:0;filter:alpha(opacity=0);} .sheet{position:relative;width:840px;height:290px;margin:auto;padding:0;background:#fff9e2 url("images/tips_bg.gif"); box-shadow:inset 0 -1px 0 #FFF,0 1px 6px rgba(0,0,0,.3); -moz-box-shadow:inset 0 -1px 0 #FFF,0 1px 6px rgba(0,0,0,.3); -webkit-box-shadow:inset 0 -1px 0 #FFF,0 1px 6px rgba(0,0,0,.3); border-bottom:2px solid #efebda; border-bottom-left-radius:5px; border-bottom-right-radius:5px; -moz-border-bottom-left-radius:5px; -moz-border-bottom-right-radius:5px; -webkit-border-bottom-left-radius:5px; -webkit-border-bottom-right-radius:5px; } .sheet a.close{display:block;position:absolute;width:20px;height:20px;right:5px;top:5px;background:url("images/sheet_close.gif") no-repeat;} .sheet a:hover.close{background-position:0 -30px;} .sheet a:active.close{background-position:0 -60px;} .sheet .head{padding:20px 15px;border-bottom:1px solid #f6f4ee;} .sheet .head h2{padding:0;font-size:18px;font-weight:400;color:#444;text-align:center;} .sheet .body{padding:10px 15px;border-top:1px solid #fff;} </style>
JS
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ var h = $(document).height(); $(".overlay").css({"height": h }); $(".action").click(function(){ $(".overlay").css({'display':'block'}).animate({'opacity':'0.8'}); $(".destroy").stop(true).animate({'margin-top':'40px','opacity':'1'},400); }); $(".close").click(function(){ $(".destroy").stop(true).animate({'margin-top':'-292px','opacity':'0'},800); $(".overlay").css({'display':'none'}).animate({'opacity':'0'}); }); }); </script>
HTML
<div id="Header"></div> <div class="demo"><a class="action" href="javascript:void(0);">jquery float浮动层弹出层页面加载特效</a></div> <div class="overlay"></div> <div class="destroy"> <div class="sheet"> <div class="head"> <h2>jquery顶部动画弹出层</h2> </div> <div class="body"></div> <a class="close" title="关闭" href="#"></a> </div> </div><!--sheet end-->

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Article discusses creating, publishing, and maintaining JavaScript libraries, focusing on planning, development, testing, documentation, and promotion strategies.

The article discusses strategies for optimizing JavaScript performance in browsers, focusing on reducing execution time and minimizing impact on page load speed.

Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

The article discusses effective JavaScript debugging using browser developer tools, focusing on setting breakpoints, using the console, and analyzing performance.

The article explains how to use source maps to debug minified JavaScript by mapping it back to the original code. It discusses enabling source maps, setting breakpoints, and using tools like Chrome DevTools and Webpack.

Once you have mastered the entry-level TypeScript tutorial, you should be able to write your own code in an IDE that supports TypeScript and compile it into JavaScript. This tutorial will dive into various data types in TypeScript. JavaScript has seven data types: Null, Undefined, Boolean, Number, String, Symbol (introduced by ES6) and Object. TypeScript defines more types on this basis, and this tutorial will cover all of them in detail. Null data type Like JavaScript, null in TypeScript

This article explores effective use of Java's Collections Framework. It emphasizes choosing appropriate collections (List, Set, Map, Queue) based on data structure, performance needs, and thread safety. Optimizing collection usage through efficient

This tutorial will explain how to create pie, ring, and bubble charts using Chart.js. Previously, we have learned four chart types of Chart.js: line chart and bar chart (tutorial 2), as well as radar chart and polar region chart (tutorial 3). Create pie and ring charts Pie charts and ring charts are ideal for showing the proportions of a whole that is divided into different parts. For example, a pie chart can be used to show the percentage of male lions, female lions and young lions in a safari, or the percentage of votes that different candidates receive in the election. Pie charts are only suitable for comparing single parameters or datasets. It should be noted that the pie chart cannot draw entities with zero value because the angle of the fan in the pie chart depends on the numerical size of the data point. This means any entity with zero proportion
