JQuery :: Splitting Text - Truncate Some Text Within A 'span' In Order To Create A 'more/less' Button To Show/hide The Additional
Mar 18, 2011
I am trying to truncate some text within a 'span' in order to create a 'more/less' button to show/hide the additional. I effectively want to turn this:
I am creating a small CMS module for a client. I created a little form and when they click Submit, it goes straight out into an include (.inc) file, which is connected to the web page to be displayed.
The trouble I am having is that I'd like to create an additional button that will insert some text (certain html tags to make their life easier, etc) - I got it to work, actually. The script executes and the text is inserted - but once the script runs and the page refreshes (or whatever it does), the text then disappears. The only way I can seem to get it to stay put is when I use "onmouseup" instead of "onclick" - which means that every time the user accidentally mouses over the thing, it inserts the text.
I'm posting this here because I assume the solution is javascript!I'd like to truncate text so that it only takes up one line, with an ellipsis if necessary. For example, instead of;
+----------------------------+ + Lorem ipsum dolor sit amet, + + consectetur adipiscing elit. +
I have one long text field in HTML to feed text as input in my page. the entered text will be shown as output text after some operations.In this context, i need to display few text(say 200 chars) only and i need to provide READMORE link/button which would show me the complete content of that text field. I need to achieve this shortly!
I am trying to hide/show table when hide/show button is pressed
Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.
I would like to display file extension along with the file links on a web page. For example, I would like to append (pdf) next to any pdf links. The following code works to some extent but not as I intended. $("a[href$='.pdf']").append(" (" + 'pdf' + ") "); If I use the above code, (pdf) is also underlined being part of the link. I want (pdf) next to the link and not as part of the link.
Need a bit of expert help with some thing i am trying to achive but cant find any code on line. all i want to do is to have a list of items in a div box on the left of the screen and when i click on one of them it shows a div box with the related text on the right side of screen in the second div box and hides any previouse showing divs on the right.
I have the following website: [URL]. As you can see, there are a couple of news items. In fact, there should be 3 items on the homepage, the rest should be hidden.
When you click the button "oudere nieuwsberichten" what means "older news", the other newsitems should be shown underneath the 3 existing ones.
I have this bit of code that shows and hides various spans and it works great in ie. It doesn't work in Newscape of Firefox - havn't tried it in Opera. How can I change this? Code:
at center of page there is a heading "Recently Posted Job" i want that functionality to make for my project i.e. changing of text or heading after a particular interval of time.
I've got this function that shows and hides a TR with-in my TABLE, but the text never changes when you click it,I would like default to be hidden, and if clicked, change text to Show and show TR. Code:
I am trying to create a chrome extension that can pass text from a text box to a webpage text box. Basically my company has an intranet site where you can search for an employee. The url does not display the search terms so i cant just append to it. Since I cant really work on this outside of work (its an intranet site) i have tried replicating it from home using the let me google that for you (www.lmgtfy.com) site.
Currently on the forum end of one of my sites, users like to create huge signatures. I would like them to have this option so I have used overflow to hide everything 150px and greater. On mousing over, the rest of the signature is displayed. This seems to annoy a lot of my members thou.Is there a way to show the overflowed text on button press using jquery or any other way?Edit:Another way to ask, a show/hide script that shows a max-height of 150px but on click shows the rest of the content.
Apologies if this question has been asked a million times. I am fairly new to this game, have got my head around html & css and now it's time to add a little interactivity... BUT i've hit my first brick wall. I am setting up a (big) panel of text which i wish to present in a more reasonable fashion by hiding the content and only showing the headers. Got the Hide:Show function working ok as shown below, but I am stuck on my next requirement...
Basically The hidden text will show and hide when told by clicking on the relevant header - but i wish to hide the text in a visible area when clicking on a new header.
im trying to do a single html page with multiple checkboxes to hide/show text when checked/unchecked. I'm really bad at html but so far I have got this: The problem I have is I dont know how to add more checkboxes.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>101st</title>
I have several input text boxes. The default value for the boxes is the description of the contents of the box. When the user clicks on the box to type, the default values disappear so they can begin typing. My problem is what if the user forgets what the contents of the box is suppose to be. I am looking for a solution where if the input box is empty, and the user deselects it, the original default value will appear. Code: <input type="text" value="Event Name" onfocus="value=''" />
This is my first post here. I'm not well versed in JavaScript, so I'm not sure how to do all the following things: (1) set up a horizontal menu with (2) + and - images as bullet points, such that clicking on the bullet points (3) changes + to - and vice versa while (4) a single-level drop down menu makes text disappear and appear.
It should look like this: --------------------------------------------- [+] Option A [+] Option B
I am trying to create a Link that changes its currently displayed text and also toggles the css.display property from inline to hidden. I'm sure there are solution outs there btu I have not been able to find one that does both functions with one click properly and is also easy to implement for people not as familiar with html and javascript. Obviously I am trying to create a show more, show less type link. currently this often shared code works fine to change the current state of the target ID's css.display from none to inline. My end goal is to be able to not only toggle the display of the LONG1 div but to also change the innerhtml of 'short1' from "Show More" to "Show Less".I am still learning about JS so Im really rough around the edges. I tried some different techniques btu I dont ahev them posted on my work pc.
I have a form with several different text boxes for things like dates, numbers, etc. arranged in a table, each row has the same kind of text boxes for data entry (10 rows probably).
I want to have a separate section above the form where I can toggle a div containing an appropriate error message to appear after the onchange event fires for the text box.
The thing is, I want all the divs with their different text messages to appear in the same place and disappear from the same place above the form instead of different places on the form or web page.
Well, they don't have to be multiple divs, but there are multiple different error messages that should appear depending where the user is typing...
Example: 'wrong format,' 'month must be between 1 and 12,' etc. Of course the messages will be nicer than this.
The thing is that first I need to detect if the div id is "sidebar" if its "sidebar" then it will pickup all the text inside h2 tag and will search for a1 or a2 in the text.If a1 is found then it will pickup the id html2 and make this div only visible.So in this case it will pickup id html2 and make it visible while other ids like html1 and html3 will be hidden.