首页 > 其他分享 >无涯教程-jQuery - Accordion组件函数

无涯教程-jQuery - Accordion组件函数

时间:2023-07-29 18:31:54浏览次数:40  
标签:jQuery accordion Accordion 无涯 item 手风琴 PHP Android

小部件手风琴功能可与JqueryUI中的小部件一起使用。手风琴与Tabs相同,当用户单击标题以展开分成逻辑部分的内容时,Accordion与Tabs相同。

Accordion - 语法

这是使用手风琴的简单语法-

$(function() {
   $( "#accordion" ).accordion();
});

Accordion - 示例

以下是显示手风琴用法的简单示例-

<!doctype html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>jQuery UI Accordion - Default functionality</title>
		
      <link rel="stylesheet" 
         href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
		
      <script type="text/javascript" 
         src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
      </script>
		
      <script type="text/javascript" 
         src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">
      </script>
		
  
      <script>
         $(function() {
            $( "#accordion" ).accordion();
         });
      </script>
   </head>
	
   <body>
      <div id="accordion">
         <h3>Android</h3>
			
         <div>
            <p>
               Android is an open source and Linux-based operating system for
               mobile devices such as smartphones and tablet computers. 
               Android was developed by the Open Handset Alliance, led by 
               Google, and other companies.
            </p>
         </div>
			
         <h3>CSS</h3>
			
         <div>
            <p>
               CSS is the acronym for "Cascading Style Sheet". This 
               tutorial covers both the versions CSS1,CSS2 and CSS3, 
               and gives a complete understanding of CSS,
               starting from its basics to advanced concepts.
            </p>
         </div>
			
         <h3>AngularJS</h3>
			
         <div>
            <p>
               AngularJS is a very powerful JavaScript library. It is used in 
               Single Page Application (SPA) projects. It extends HTML DOM
               with additional attributes and makes it more responsive to 
               user actions. AngularJS is open source, completely free, 
               and used by thousands of developers around the world.
               It is licensed under the Apache license version 2.0.
            </p>
				
            <ul>
               <li>List item one</li>
               <li>List item two</li>
               <li>List item three</li>
            </ul>
				
         </div>
			
         <h3>PHP</h3>
			
         <div>
            <p>
               The PHP Hypertext Preprocessor (PHP) is a programming language 
               hat allows web developers to create dynamic content that
               interacts with databases. PHP is basically used for developing 
               web based software applications. This tutorial helps you to 
               build your base with PHP.
            </p>
				
            <p>
               Before proceeding with this tutorial you should have at least basic 
               understanding of computer programming, Internet, Database, and 
               MySQL etc is very helpful.
            </p>
				
         </div>
      </div>
   </body>
</html>

这将产生以下输出-

参考链接

https://www.learnfk.com/jquery/widget-accordion.html

标签:jQuery,accordion,Accordion,无涯,item,手风琴,PHP,Android
From: https://blog.51cto.com/u_14033984/6894344

相关文章

  • 无涯教程-jQuery - Sortable排序函数
    能够排序功能可与JqueryUI中的交互配合使用。此功能可在任何DOM元素上启用可排序功能。单击并将其拖动到列表中的新位置,其他项将调整以适合。默认情况下,可排序项目共享可拖动属性。Sortable-语法$(function(){$("#sortable").sortable();$("#sortable").disabl......
  • 无涯教程-jQuery - Resizeable调整大小函数
    能够调整大小功能可与JqueryUI中的交互配合使用。可以在任何DOM元素上启用"调整大小功能"功能。使用光标抓住右边框或底边框并拖动到所需的宽度或高度。Resizeable-语法$("#resizable").resizable();Resizeable-示例以下是显示可调整大小的用法的简单示例-<!doctype......
  • 无涯教程-jQuery - Dropable移动函数
    Drop-able功能可与JqueryUI中的交互一起使用。此功能可在任何DOM元素上启用可放置功能。Dropable-语法$("#droppable").droppable();Dropable-示例以下是一个简单的示例,显示了drop-able的用法-<html><head><title>ThejQueryExample</title><s......
  • 无涯教程-jQuery - Transfer方法函数
    Transfer效果可以与effect()方法一起使用。这会将元素的轮廓转移到另一个元素。尝试可视化两个元素之间的交互时非常有用。Transfer-语法selector.effect("transfer",{arguments},speed);这是所有参数的描述-className  - 传输元素将收到的可选类名。to  ......
  • 无涯教程-jQuery - Slide方法函数
    幻灯片效果可以与show/hide/toggle一起使用。这会将元素滑出视口。Slide-语法selector.hide|show|toggle("slide",{arguments},speed);这是所有参数的描述-direction -效果的方向。可以是"左(left)","右(right)","上(up)","下(down)"。默认值:left。distance  -......
  • 无涯教程-jQuery - Scale方法函数
    Scale效果可以与show/hide/toggle一起使用。这会使元素缩小或增长一个百分比因子。Scale-语法selector.hide|show|toggle("scale",{arguments},speed);这是所有参数的描述-direction        -方向。可以是"both","垂直(vertical)"或"horizontal"。......
  • 无涯教程-jQuery - Highlight方法函数
    Highlight效果可以与effect()方法一起使用。这将以特定的颜色突出显示元素的背景,默认为黄色(yellow)。Highlight-语法selector.effect("highlight",{arguments},speed);这是所有参数的描述-color  - 高亮显示颜色。默认值为"#ffff99"。model - 效果的模式......
  • 无涯教程-jQuery - Puff方法函数
    吹气效果可以与show/hide/toggle一起使用。通过按比例放大元素并同时隐藏它,可以形成粉扑效果。Puff-语法selector.hide|show|toggle("puff",{arguments},speed);这是所有参数的描述-model         - 效果的模式。可以是"显示(show)"或"隐藏(hide)"......
  • 无涯教程-jQuery - show( )方法函数
    show()方法仅显示匹配元素中的每个元素(如果隐藏)。此方法还有另一种形式,可以控制动画的速度。show()-语法selector.show();show()-示例以下是一个简单的示例,简单说明了此方法的用法-<html><head><title>ThejQueryExample</title><scripttype=......
  • 关于Jquery jqGrid的使用
    [color=red][b]官方文档[/b][/color]:[url]http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jqgriddocs[/url]jqGrid使用总结[url][/url]jqGrid的属性列表:[url]http://www.helloweba.com/view-blog-162.html[/url]jqgrid的一些操作动态增加列用......