• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 132
  • Last Modified:

Adjust li item

Hi,
I know it is one li item below
https://dl.dropboxusercontent.com/u/40211031/t826.png

is there one example to that kind of li item that is showing the same like the above, and when the mouse is hovering on top of the li item, it will show with more details like
https://dl.dropboxusercontent.com/u/40211031/t827.png
0
HuaMinChen
Asked:
HuaMinChen
  • 3
  • 3
2 Solutions
 
Julian HansenCommented:
Try this
<!doctype html>
<html>
<head>
<title>Test</title>
<script src="http://code.jquery.com/jquery.js"></script>
<script type="text/javascript">
$(function() {
});
</script>
<style type="text/css">
ul {
  list-style: none;
}
ul li {
  display: inline-block;
  position: relative;
  height: 194px;
  width: 259px;
}
ul li > div {
  background: rgba(255,255,255,0.5);
  color: blue;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 10px;
  position: absolute;
  bottom: 0;
}
ul li div div {
  display: none;
}
ul li:hover div div {
  display: block;
  color: black;
}
</style>
</head>
<body>
<ul>
  <li>
    <img src="test.jpg" />
    <div>
      Normal text
      <div>Additional Text</div>
  </li>
</ul>
</body>
</html>

Open in new window

Working sample here http://www.marcorpsa.com/ee/e015.html
0
 
HuaMinChenBusiness AnalystAuthor Commented:
Many many thanks Julian.

how to apply your way to "Additional text" to tb_p1_desc2 textbox below?

    <style type="text/css">
         ...
         ul.imagesList .imagesList-item-frame {
             border: solid 1px #dcdcdc;
             position: absolute;
             padding: 3px;
             top: 3px;
             right: 3px;
             bottom: 3px;
             left: 3px;
         }
         ul.imagesList li img {
             width: 100%;
             height: 140px;
         }
         ul.imagesList li .legend {
             width: 100%;
             margin: 3px 3px 0 3px;
         }
         ...
    </style> 
                    <li><a href="#">
                        <div class="imagesList-item-frame shadow">
                            <img src=<%=lb_pict1.Text %> />
                            <div class="legend">
                                <div style="height:18px; width:92px; font-size:small; border:none; background-color:#1BA8E0">
                                    <label id="Label13" runat="server"><b>Desc</b></label>
                                <div>
                                <input type="textbox" id="tb_p1_desc" style="height:20px; width:116px; border:inherit; background-color:#F0FAF9;" runat="server" /><br/>
                                <input type="textbox" id="tb_p1_desc2" style="height:20px; width:116px; border:inherit; background-color:#F0FAF9;" runat="server" /><br/><br/>
                                <input type="button" id="butt_p1" onclick="openPopup();" style="height:23px; width:97px" value="Test" runat="server" />
                            </div>
                        </div>
                    </li>
                    ...

Open in new window

0
 
Julian HansenCommented:
I am confused about the following

a) you have input type="textbox" - do you want a <textbox> or input type="text"? textbox is not a valid attribute for the input element http://www.w3schools.com/tags/tag_input.asp

b) Do you only want that textbox to be shown on hover

c) The textboxes, Desc and button are currently showing below the image - do you want them all to be positioned over the image - is that part of your question?

Here is some code - not sure if it does what you want but try it and let me know
<!doctype html>
<html>
<head>
<title>e</title>
    <style type="text/css">
		 ul.imagesList li {
			position: relative;
			border: 1px solid black;
		 }
         ul.imagesList .imagesList-item-frame div.legend{
             border: solid 1px #dcdcdc;
             position: absolute;
             padding: 3px;
             bottom: 3px;
         }
         ul.imagesList li .legend {
             width: 100%;
             margin: 3px 3px 0 3px;
         }
		 ul.imagesList li:hover input {
			display: block !important;
		 }
    </style> 
</head>
</body>	
	<ul class="imagesList">
		<li><a href="#">
			<div class="imagesList-item-frame shadow">
				<img src="test.jpg" />
				<div class="legend">
					<div>
						<label id="Label13" runat="server"><b>Desc</b></label>
					<div>
					<input type="text" id="tb_p1_desc" style="height:20px; width:116px; border:inherit; background-color:#F0FAF9;" runat="server" /><br/>
					<input type="text" id="tb_p1_desc2" style="height:20px; width:116px; border:inherit; background-color:#F0FAF9; display: none" value="TEST:" runat="server" /><br/><br/>
					<input type="button" id="butt_p1" onclick="openPopup();" style="height:23px; width:97px" value="Test" runat="server" />
				</div>
			</div>
			</a>
		</li>
	</ul>
</body>
</html> 

Open in new window

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
HuaMinChenBusiness AnalystAuthor Commented:
Thanks a lot Julian.
How to decrease the space between textbox and text item below?
https://dl.dropboxusercontent.com/u/40211031/t830.png
0
 
Julian HansenCommented:
Delete the <br/> element from the end of the line
If necessary add a margin to the input to create whatever gap you need between them.
0
 
HuaMinChenBusiness AnalystAuthor Commented:
Many thanks Julian.
Can you please help to this thread?
http://www.experts-exchange.com/Programming/Languages/.NET/Q_28535047.html#a40372342
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now