Jump to content

Css Help


Boswell

Recommended Posts

Does anyone know how to manipulate images within spliced tables? I need to manipulate them with CSS so that that bottom half of the image is revealed only when it is clicked or hovered over?


<!-- Save for Web Slices (BannerEdit.psd) -->

<table id="Table_01" width="974" height="220" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td colspan="6">

			<img src="images/SpliceBanner_01.jpg" width="974" height="137" alt=""></td>

	</tr>

	<tr>

		<td rowspan="3">

			<img src="images/SpliceBanner_02.jpg" width="78" height="83" alt=""></td>

		<td rowspan="3">

			<img src="images/Home.gif" width="208" height="83" alt=""></td>

		<td colspan="4">

			<img src="images/SpliceBanner_04.jpg" width="688" height="1" alt=""></td>

	</tr>

	<tr>

		<td rowspan="2">

			<img src="images/Services.gif" width="207" height="82" alt=""></td>

		<td colspan="3">

			<img src="images/SpliceBanner_06.jpg" width="481" height="1" alt=""></td>

	</tr>

	<tr>

		<td>

			<img src="images/Contact.gif" width="205" height="81" alt=""></td>

		<td>

			<img src="images/Gallery.gif" width="198" height="81" alt=""></td>

		<td>

			<img src="images/SpliceBanner_09.jpg" width="78" height="81" alt=""></td>

	</tr>

</table>

<!-- End Save for Web Slices --> 

Link to comment
Share on other sites

At a guess you'd need to use jQuery or Javascript to do this, but it'll be made more difficult because you're using a table. Also, have a quick search on "tables for layout", people have written massive articles on why you should avoid them.

If you were using a div based layout, then jQuery has this kind of functionality built in, it would only take a few lines of code.

Link to comment
Share on other sites

what you want to look into is 'css sprites'.

Basically set the background for one of the cells:

td {
background: url('path/to/image.png');
background-position: 0 0;
}[/code] then you want to shift that image upwards when the cell is being hovered over:
[code]td:hover {
background-position: -200px 0; /** I can never remember which way these positions work, so play around in firebug until its right **/
}

pretty straight forward. and yeah.. try not to use tables :)

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...