|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Highlighing items generated from mySQL
Hello all!
I have a php/msql database and I am pulling items from it based on which category a user has chosen. I then have pictures of some of the items in that category. Here's my question: How do I set it up so that when a user clicks on a picture, the corresponding text (which has been displayed using a mysql_fetch_object() loop) is highlighted on the page somehow. It can be highlighted or pointed to with an arrow, or whatever. I've tried using layers. Generating a new layer named after each item name was easy. Assigning text to that layer when the image was clicked was also easy. Getting rid of that text when another image was clicked.... brick wall (can be done but with TONS of HTML). I'm looking for a time-saver. Any help would be great. Thanks for listening! |
|
#2
|
||||
|
||||
|
Are you creating a list of items? If so, you should be using the UL/LI to markup it up semantically. Using CSS, you can do a whole bunch of nifty stuff to present your list. E.g
Code:
<!-- the HTML -->
<ul>
<li><a href="#">Item 1 - Blah</a></li>
<li class="altRowColor"><a href="#">Item 2 - Foo</a></li>
<li><a href="#">Item 3 - Bar</a></li>
<li class="altRowColor"><a href="#">Item 4 - Honky Tonk</a></li>
<ul>
<!-- the CSS -->
ul {
list-style-type : none;
margin : 0;
padding : 0;
}
li {
background-color : lightsteelblue;
}
li.altRowColor {
background-color : blue;
}
li a {
display : block;
padding : 2px;
}
li a:hover {
background-color : red;
}
|
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Highlighing items generated from mySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|