Solved

jquery truncates text in button

Posted on 2014-02-14
2
265 Views
Last Modified: 2014-04-07
We are developing a survey module for mobiles and tablets using jquery mobile.

On screen, we present the User with a question and a number of options (responses) to select.

If the response is long we want the button to automatically size vertically and wrap the text within the horizontal width of the button.

Currently the text simply truncates so as to make it unreadable.  So as an example:

Correct Text
"I disagree completely with this statement"

Displayed Text
"I disagree comp ..."

The amount of text varies significantly for different responses, so we don't want to create a huge fixed text box just for the odd one or two long responses (it also reduces the space available for the questions)

Any ideas as to a viable solution would be greatly appreciated :)
0
Comment
Question by:Chris_Ryan
2 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39861001
Can you provide a sample code.  This seems to work fine.  http://jsbin.com/gekop/1


<!DOCTYPE html>
<html>
<head>
<link href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <button>Yes</button>
  <button>No</button>
  <button>I disagree completely with this statement</button>

</body>
</html>

Open in new window

0
 

Author Comment

by:Chris_Ryan
ID: 39863161
Hi Scott,

Thanks so much for this

We are closed over the weekend, but we'll check it out on Monday and get back to you with our sample code

Cheers
Chris
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question