jQuery Mobile FilterTheme选项

jQuery Mobile FilterTheme选项

jQuery Mobile是一个基于HTML5的用户界面系统,旨在制作可在所有智能手机、平板电脑和桌面设备上使用的响应式网站和应用程序。Filterable是一个可以过滤任何元素的孩子的小工具。一个表单、列表等都可以在filterable的帮助下进行过滤。一个搜索栏出现在列表的顶部,搜索文本就写在那里。

在本教程中,我们将学习jQuery Mobile的FilterTheme选项。filterTheme选项可以设置搜索占位符面板的颜色标签。

$(".items").filterable({
    filterTheme: "a",
});

CDN链接:jQuery Mobile项目使用以下CDN链接。

<link rel=”stylesheet” href=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css” />
<script src=”https://code.jquery.com/jquery-1.11.1.min.js”></script>
<script src=”https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js”></script>

例子:在下面的例子中,我们使用字符 “b“将FilterTheme设置为**dark。

<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" 
          href=
"https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
    <script src="https://code.jquery.com/jquery-1.11.1.min.js">
    </script>
    <script src=
"https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js">
    </script>
</head>
  
<body>
    <h1 style="color:green">
        GeeksforGeeks
    </h1>
    <h3>jQuery Mobile Filterable filterTheme Option</h3>
    <ul class="items">
        <li>
            <a href=
"https://www.geeksforgeeks.org/data-structures" 
               target="_blank">
                Data Structures
            </a>
        </li>
        <li>
            <a href=
"https://practice.geeksforgeeks.org/courses/complete-interview-preparation" 
               target="_blank">
                Interview preparation
            </a>
        </li>
        <li>
            <a href=
"https://www.geeksforgeeks.org/java"
               target="_blank">
                Java Programming
            </a>
        </li>
    </ul>
    <script>
        $(".items").filterable({
            filterTheme: "b",
        });
    </script>
</body>
  
</html>

输出:

jQuery Mobile可过滤主题选项

Python教程

Java教程

Web教程

数据库教程

图形图像教程

大数据教程

开发工具教程

计算机教程