Go Back   Dreamweaver Club Forums > Hand Coders Forum > Javascript and JS frameworks
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 10-14-2010, 08:22 AM   #1
Rob_Che's Avatar
Join Date: Feb 2008
Posts: 1,553
Default Useful jQuery Scripts

There are some scripts that I use ALL the time - on pretty much every site I build...

Here's one for starters.

Make a full <li > block a clickable area.
So - you have a list recent blog posts (or any list) and they are built of a few elements (image, title, brief description etc) but you want the whole thing to be clickable.

Try this:

<ul id="myList">
          <img src="/image.gif">
               Some text
               <a href="#">READ MORE</a>
So, you can see we have four elements in that <li> - but what if a user clicks the image or the title? I guess we could give them ALL link tags but that seems a bit heavy handed - so...

<script type="text/javascript">
          $("#myList li").click(function(){
          return false;
The script finds the link tag ".find .attr href" and places it as a click function for the li as a block.
Rob_Che is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 09:44 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com