Banner ad shrink effect code implemented by jquery_jquery
The example in this article describes the Banner ad shrinking effect code implemented by jquery. Share it with everyone for your reference. The details are as follows:
Here is a demonstration of the shrinking effect of a Banner ad. After clicking it, the webpage will display a large ad. After clicking "Close" with the mouse, the ad will shrink. This effect has been seen on major websites. You are welcome to learn from it.
The screenshot of the running effect is as follows:
The online demo address is as follows:
http://demo.jb51.net/js/2015/jquery-banner-show-close-style-codes/
The specific code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>一个Banner广告收缩效果</title> <style type="text/css"> *{margin:0; padding:0;}/*为了方便 直接这样重置了*/ #main{margin:0 auto; width:960px;} #banner{display:none; margin:0 auto; width:960px; height:160px; background:url(images/banner.png) no-repeat; position:relative;} #close{display:block; width:50px; height:22px; text-align:center; line-height:22px; border:1px #ddd solid; background:#000; color:#fff; font-size:12px; float:right; cursor:pointer;} </style> <script type="text/javascript" src="jquery-1.6.2.min.js"></script> <script type="text/javascript"> $ ( function() { $("#banner").slideDown(); var Up=function(){$("#banner").slideUp(1500)} setTimeout(Up,3000); $("#close").click ( function() { $("#banner").slideToggle ( 600,function() { if($("#banner").css("display") == "none") { $("#close").text("打开"); } else { $("#close").text("关闭"); } } ); } ); } ); </script> </head> <body> <div id="main"> <div id="banner"></div> <span id="close">关闭</span> </div> </body> </html>
I hope this article will be helpful to everyone’s jquery programming design.

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



How to turn off the ads recommended by 360 Browser? I believe that many users are using 360 Browser, but this browser sometimes pops up advertisements, which makes many users very distressed. Let this site carefully introduce to users how to Turn off the ads recommended by 360 Browser on your computer. How to turn off the ads recommended by 360 Browser on your computer? Method 1: 1. Open 360 Safe Browser. 2. Find the "three horizontal bars" logo in the upper right corner and click [Settings]. 3. Find [Lab] in the taskbar on the left side of the pop-up interface, and check [Enable "360 Hotspot Information" function]. Method 2: 1. First double-click

Users will encounter a lot of advertisements when browsing Moments, so how can they completely turn off the advertisements? Users need to click Settings in My, then find Personal Information and Permissions, then click Personalized Ads Management, and just turn off ad personalization. This article will tell you how to completely turn off ads in Moments, so take a look! WeChat usage tutorial: How to completely turn off ads in Moments? Answer: It cannot be turned off completely. You can only turn off personalized recommendations. Specific methods: 1. First, click on me, and then find the settings inside. 2. Find the personal information and permissions options. 3. Click on the personalized advertising management function inside. 4. Click the switch on the right side of ad personalization and turn it off. How to turn off ads: 1. Find the ads in Moments. 2. Click right

After updating the Edge browser, many users found that there were a lot of advertisements on the interface. For example, at the bottom of the new tab page, there were links to multiple websites and the word advertisements were marked, which looked very annoying. Is there any way to turn off personalized ads in Edge browser? The editor has searched many methods on the Internet, and I will share with you a little trick to turn off ads. How to turn off ads in the new version of Edge? 1. Open the Edge browser. 2. Click [•••] in the upper right corner. 3. Click [Settings]. 4. Click [Privacy, Search and Services]. 5. Turn off the switch on the right side of "Personalize your web experience" to turn off the personalization pushed by Microsoft.

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

When we usually use Douyin for entertainment, we often have some inexplicable and strange advertisements that disturb our leisure experience. Many users are not disturbed by them and want to turn off the recommendation push of these advertisements, but they don't. If you know how to operate it, then the editor of this website will bring you this tutorial guide and this detailed introduction, hoping to help everyone in need. First, we first find the option to understand and manage ad push in the app settings, then see all the ad-related switch options below, click the switch at the back to turn it off, and then a confirmation prompt to turn off the ad will pop up, we click to confirm. Close ads

Title: jQuery Tips: Quickly modify the text of all a tags on the page In web development, we often need to modify and operate elements on the page. When using jQuery, sometimes you need to modify the text content of all a tags in the page at once, which can save time and energy. The following will introduce how to use jQuery to quickly modify the text of all a tags on the page, and give specific code examples. First, we need to introduce the jQuery library file and ensure that the following code is introduced into the page: <

Title: Use jQuery to modify the text content of all a tags. jQuery is a popular JavaScript library that is widely used to handle DOM operations. In web development, we often encounter the need to modify the text content of the link tag (a tag) on the page. This article will explain how to use jQuery to achieve this goal, and provide specific code examples. First, we need to introduce the jQuery library into the page. Add the following code in the HTML file:

Kuaishou Express Edition has always been so popular with everyone. It can view a large number of videos every day. It is constantly updated, so that everyone can see these wonderful video contents anytime, anywhere. It is really rich, diverse and direct. To relieve worries and boredom, sometimes everyone always encounters some advertising pop-ups, which directly affects everyone's perception of watching videos, so everyone wants to close these advertising pop-ups to obtain a more comfortable viewing experience. Friends who don’t know how to operate it can take a look at the tutorial I brought to you. How to turn off advertising push in Kuaishou Express Edition: 1. First open the Kuaishou Express Edition software, go to the Kuaishou page and click the [three horizontal lines] icon in the upper left corner; 2. Then click [Settings] on the current page; 3. Enter
