d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Need Help With Jquery Ui Button Widget
Add Reply New Topic New Poll
Member
Posts: 24,772
Joined: Mar 7 2008
Gold: 15.00
Oct 20 2014 02:10pm
I'm currently using Next and Previous Button to navigate through elements and I want to upgrade with jquery-ui.

It should display a left arrow and right arrow but buttons still displaying default text


Here is the code


HTML

head
Code

<head>
<title>The Beer-O-Rama</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script src="javascript/jquery-2.1.1.min.js"></script>
<script src="javascript/jquery-ui.min.js"></script>
<script type="text/javascript" src="javascript/script.js"> </script>
</head>



body

Code
<div id="NavBeer">
<input type="button" id="idPrevious" name="Previous" value ="Previous"/>
<input type="button" id="idNext" name="Next" value ="Next"/>
</div>



js file

Code
$(function() {
$( "#idPrevious" ).button({ text: false });
$("#idPrevious" ).button({ icons: { primary: "ui-icon-triangle-1-w"} });
});


the patch os the js file is correct

my jquery-ui version --> jQuery UI - v1.11.1 - 2014-09-21


Member
Posts: 24,772
Joined: Mar 7 2008
Gold: 15.00
Oct 20 2014 02:58pm
I think something is missing in my jquery-ui file
Member
Posts: 24,772
Joined: Mar 7 2008
Gold: 15.00
Oct 20 2014 06:19pm
here with updated head:


Code
<head>
<title>The Beer-O-Rama</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.theme.min.css" >
<link rel="stylesheet" type="text/css" href="css/jquery-ui.structure.min.css" >
<link rel="stylesheet" type="text/css" href="css/jquery-ui.min.css"
<script src="javascript/jquery-2.1.1.min.js"></script>
<script src="javascript/jquery-ui.min.js"></script>
<script type="text/javascript" src="javascript/script.js"> </script>
</head>




buttons now looks like this:



but I would like to have an icon on it instead of text

>
Member
Posts: 29,723
Joined: Jun 11 2007
Gold: 279.52
Oct 20 2014 09:14pm
jquery is fine


button is not an input type

it shoudl be

Code
<button id="idPrevious">Previous</button>
Member
Posts: 29,723
Joined: Jun 11 2007
Gold: 279.52
Oct 20 2014 09:45pm
oh and make sure u run it live

jquery usually doesnt work locally
Member
Posts: 24,772
Joined: Mar 7 2008
Gold: 15.00
Oct 21 2014 07:13pm
Quote (AkuuZ @ 20 Oct 2014 22:45)
oh and make sure u run it live

jquery usually doesnt work locally


that worked ty
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll