Jump to content

jQuery help


adambedford

Recommended Posts

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.