-
Resent Posts
Tags
chart charting datagrid datagridview grid gridview html5 chart html5 Grid JavaScript javascript chart javascript grid javascript gridview javascript listbox javascript splitter jQuery jquery chart jquery datagrid jquery grid jquery grid plugin jquery gridview jquery listbox jQuery Plugins jquery splitter jQuery Tree jQuery UI jquery ui grid jQuery UI Plugins jquery ui splitter jQuery UI Widgets jQuery Widgets jQWidgets jqxchart jqxGrid jqxlistbox jqxsplitter ListBox listbox widget split container split layout splitter splitter plugin Tab Control Tabs tree treeviewCategories
- ASP .NET
- JavaScript
- JavaScript Plugins
- JavaScript UI
- JavaScript UI Plugins
- JavaScript UI Widgets
- JavaScript Widgets
- jQuery
- jQuery Plugins
- jQuery UI
- jQuery UI Plugins
- jQuery UI Widgets
- jQuery Widgets
- jQWidgets
- jqxButton
- jqxCalendar
- jqxChart
- jqxCheckBox
- jqxComboBox
- jqxDateTimeInput
- jqxDock
- jqxDropDownList
- jqxExpander
- jqxGrid
- jqxInput
- jqxListBox
- jqxMaskedInput
- jqxMenu
- jqxNavigationBar
- jqxNumberInput
- jqxProgressBar
- jqxRadioButton
- jqxRating
- jqxScrollBar
- jqxSlider
- jqxSplitter
- jqxTabs
- jqxTooltip
- jqxTree
- jqxValidator
- jqxWindow
- PHP
- Uncategorized
jQuery Button with Image
This post illustrates how to add a jQuery Button with Image to a web page in a few steps.
The first step is to add the Button’s HTML code. The jqxButton can be created either from DIV tag or INPUT tag. To display an image in the Button, we need to create it from a DIV tag. In the HTML below, we add a DIV tag for the Button , IMG tag for the Button’s image and another DIV tag for the Button’s Text.
[html]
<div id=’jqxButton’>
<img style=’float: left; margin: 4px;’ src=’../../images/numberinput.png’ />
<div style=’float: left; margin: 4px;’>
Button</div>
</div>
[/html]
The second step is to add the dependency script files. To use the jQWidgets Button, we need to add following javascript files to the web page.
[javascript]
<script type="text/javascript" src="../../scripts/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
<script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
[/javascript]
The third step is to add the CSS stylesheet files. In this post, we will use the ‘DarkBlue’ theme and we need to load the base and darkblue styles.
[javascript]
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
<link rel="stylesheet" href="../../jqwidgets/styles/jqx.darkblue.css" type="text/css" />
[/javascript]
The final step is to create the Button by using the jqxButton constructor. We pass three parameters to the constructor – width, height and theme name.
[javascript]
$("#jqxButton").jqxButton({ width: ’80px’, height: ’25px’, theme: ‘darkblue’ });
[/javascript]
This entry was posted in JavaScript, JavaScript Plugins, JavaScript Widgets, jQuery, jQuery Plugins, jQuery UI, jQuery UI Plugins, jQuery UI Widgets, jQuery Widgets, jQWidgets, jqxButton and tagged button, button widget, html5 button, javascript button, jquery button, jquery button plugin, jquery button widget, jQuery UI, jquery ui button. jqxbutton, jQWidgets. Bookmark the permalink.
One Response to jQuery Button with Image
Leave a Reply Cancel reply
You must be logged in to post a comment.

Nice post
just what I was looking for