adambedford Posted March 17, 2010 Share Posted March 17, 2010 I need help with a couple of things that I think can be best accomplished in jQuery. I'm writing an application for business listings and right now I'm dealing with the actual listings page. I have a query (in PHP MySQL) that displays a list of records. On load, the name of the business and the description is displayed, however I want to truncate the text of the description to keep everything neat and tidy. When a user clicks on a particular record, I want the container div to expand to display further information about the business and I also want the truncated text to expand fully. Now I know there are plenty of individual scripts on the web for show/hiding divs and I've had a play around with adjusting the height of a div with jQuery and CSS and I've also found a jQuery plugin called jTruncate that truncates the text...but I'm struggling with putting it all together. The main problem I have with the jTruncate (and all other truncate scripts) is that they add their own 'See more' link, and I want to complete all operations with my own stylized button. The other predicament I have is related to displaying the other information. I don't know whether to expand the current div (change height property) or to show another div beneath it. Ideally I'd like the same div to slide down and then within that I can show other HTML and maybe even another div. Does anyone have any suggestions as to how I can do all this with one click of the mouse? I'm really (really!) new to jQuery (and pretty much to javascript) so any help would be greatly appreciated. If anyone knows how to do this (I'm sure its quite simple, I'm just not knowledgeable enough to know how!) using methods other than jQuery...I'd be really appreciative of that advice as well! Plain old javascript might be just as effective. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/195578-jquery-help/ Share on other sites More sharing options...
nafetski Posted March 18, 2010 Share Posted March 18, 2010 Check the plugin documentation, chances are you can set an option for how you want things to be styled. Very unusual for a plugin to force any type of style functionality on you. Quote Link to comment https://forums.phpfreaks.com/topic/195578-jquery-help/#findComment-1028311 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.