Home > Web Front-end > JS Tutorial > jQuery simply binds a single event instance to share

jQuery simply binds a single event instance to share

小云云
Release: 2018-01-10 09:38:32
Original
1862 people have browsed it

This article mainly introduces the method of jQuery to simply bind a single event. It analyzes the related operation skills of jQuery using the bind method for event binding and event response based on specific examples. Friends who need it can refer to it. I hope it can help everyone. .

The example in this article describes how jQuery simply binds a single event. Share it with everyone for your reference, the details are as follows:


<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>绑定单个事件</title>
  <script type="text/javascript" src="jquery-1.7.2.min.js"></script>
  <script language="JavaScript">
    $(document).ready(function () {
      $("input[name=event_1]").bind({
        mouseover:function () {
          $("ul").css("display","none");
        },
        mouseout:function () {
          $("ul").css("display","block");
        }
      });
    });
  </script>
</head>
<body>
<h1>壹基金</h1>
<h2>简介</h2>
<p>2007年,李连杰先生创立启动了壹基金。深圳壹基金公益基金会2010年12月3日再深圳注册成立,是中国第一家民间公募基金会。</p>
<h2>战略及策略</h2>
<p>壹基金的公益愿景为"尽我所能,人人公益"。壹基金战略模式为"一个平台+三个领域",即搭建专业透明的壹基金公益平台。</p>
<h2>公益活动</h2>
<ul>
  <li>为爱同行</li>
  <li>关注自闭儿童</li>
  <li>雅安地震救援</li>
</ul>
<input name="event_1" type="button" value="绑定单个事件" />
</body>
</html>
Copy after login

Have you learned it? Hurry up and try it out.

Related recommendations:

Detailed explanation of the process from learning bind to implementing bind in Javascript

.bind(), .live in Jquery Sharing examples of the differences between (), .delegate() and .on()

Detailed explanation of bind() function in jQuery

The above is the detailed content of jQuery simply binds a single event instance to share. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template