Introduction: jQWidgets is a JavaScript framework for making web-based applications for PC and mobile devices. It is a very powerful and optimized framework, platform-independent, and widely supported. The jqxTabs represents a jQuery Tab widget that is used for breaking the content into multiple sections. The <li> elements are used for tab title and <div> elements are used for tab content.
The addFirst() method is used for adding the tab at the beginning position. The adding tab contains the title and content of tab. This method accepts two parameters which are given below:
- tabTitle: It accepts the title of newly added tab.
- tabContent: It accepts the content of newly added tab.
Syntax:
$('Selector').jqxTabs('addFirst', tabTitle, tabContent);
Linked Files: Download jQWidgets from the given link https://www.jqwidgets.com/download/. In the HTML file, locate the script files in the downloaded folder.
<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<link rel=”stylesheet” href=”jqwidgets/styles/jqx.energyblue.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxtabs.js”></script>
The below example illustrates the jQWidgets jqxTabs addFirst() method.
Example:
<!DOCTYPE html> < html lang = "en" >
< head >
< link rel = "stylesheet" href =
"jqwidgets/styles/jqx.base.css" type = "text/css" />
< link rel = "stylesheet" href="
jqwidgets/styles/jqx.energyblue.css" type = "text/css" />
< script type = "text/javascript" src = "scripts/jquery-1.11.1.min.js" ></ script >
< script type = "text/javascript" src = "jqwidgets/jqx-all.js" ></ script >
< script type = "text/javascript" src = "jqwidgets/jqxcore.js" ></ script >
< script type = "text/javascript" src = "jqwidgets/jqxtabs.js" ></ script >
</ head >
< body >
< center >
< h1 style = "color: green;" >
GeeksforGeeks
</ h1 >
< h3 >
jQWidgets jqxTabs addFirst() Method
</ h3 >
< div id = 'jqxTabs' >
< ul style = 'margin-left: 20px;' >
< li >GeeksforGeeks</ li >
< li >HTML</ li >
< li >CSS</ li >
< li >JavaScript</ li >
</ ul >
< div >
A Computer Science portal for geeks.
It contains well written, well thought
and well explained computer science
and programming articles, ...
</ div >
< div >
HTML stands for HyperText Markup
Language. It is used to design web
pages using a markup language. HTML
is the combination of Hypertext and
Markup language. Hypertext defines
the link between the web pages.
</ div >
< div >
Cascading Style Sheets, fondly referred
to as CSS, is a simply designed language
intended to simplify the process of making
web pages presentable. CSS allows you to
apply styles to web pages. More importantly,
CSS enables you to do this independent of
the HTML that makes up each web page.
</ div >
< div >
JavaScript is a lightweight, cross-platform,
and interpreted scripting language. It is
well-known for the development of web pages,
many non-browser environments also use it.
JavaScript can be used for Client-side
developments as well as Server-side developments.
</ div >
</ div >
</ center >
< script type = "text/javascript" >
$(document).ready(function() {
$('#jqxTabs').jqxTabs({
theme: 'energyblue',
width: 550,
height: 150
});
$('#jqxTabs').jqxTabs('addFirst', 'PHP',
`The term PHP is an acronym for PHP:
Hypertext Preprocessor. PHP is a
server-side scripting language designed
specifically for web development. It is
open-source which means it is free to
download and use. It is very simple to
learn and use. The files have the
extension “.php”.`
);
});
</ script >
</ body >
</ html >
|
Output:
Reference: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxtabs/jquery-tabs-api.htm