Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


debasis
ToolTip Code
1 Answer(s)      4 years and 2 months ago
Posted in : Design concepts & design patterns


Dear Sir,
One more question i have.In my web page many students' roll number are there.I want to dispaly student's information just after placing the mouse on that roll number.(Details like-age,sex.location.)Only by placing,not by clicking.No new page should open.I heard ki Tooltip can be used as bookmyshow and yatra.com web sites are using to show flight details only by placing the mouse on that flight number.Can you pliz give me the code and how to use.If function is used in the bean,pliz give me..

Regards
Debasis

Advertisement
View Answers

July 19, 2010 at 1:00 PM


Hi Friend,

Try the following code:

<%@page import="java.sql.*"%>
<script type="text/javascript">
function show(item,name,address,age,gender){
hp = document.getElementById("div");
hp.innerHTML = "Name: "+name+"<br>Address: "+address+"<br>Age: "+age+"<br>Gender: "+gender;
hp.style.top = item.offsetTop + 18;
hp.style.left = item.offsetLeft + 20;
hp.style.visibility = "Visible";
}
function hide(){
hp = document.getElementById("div");
hp.style.visibility = "Hidden";
}
</script>
<body onload="hide();">
<table >
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root";, "root");
Statement st=connection.createStatement();
ResultSet rs=st.executeQuery("select * from student");

while(rs.next()){
String roll=rs.getString("rollNo");
String name=rs.getString("name");
String address=rs.getString("address");
String age=rs.getString("age");
String gen=rs.getString("gender");

%>
<tr><td style="cursor:default;" onMouseOver="show(this,'<%=name%>','<%=address%>','<%=age%>','<%=gen%>');" onMouseOut="hide();"><%=roll%><div id="div" style="border: 2px solid rgb(0, 0, 0); width: 250px; height: 100px;background-color:blue;visibility:hidden; position:absolute; top:0; left:0;"></div></td>
</tr>
<%
}%>
</table>
</body>

For the above code, we have created a table 'student':

CREATE TABLE `student` (
`rollNo` bigint(40) NOT NULL auto_increment,
`name` varchar(40) default NULL,
`address` varchar(20) default NULL,
`age` int(40) default NULL,
`gender` varchar(10) default NULL,
PRIMARY KEY (`rollNo`)
)

Thanks





Related Tutorials/Questions & Answers:
ToolTip Code - Design concepts & design patterns
ToolTip Code  Dear Sir, One more question i have.In my web...)Only by placing,not by clicking.No new page should open.I heard ki Tooltip can... only by placing the mouse on that flight number.Can you pliz give me the code
ToolTip Code - Design concepts & design patterns
ToolTip Code  Dear Sir, One more question i have.In my web page many... by placing,not by clicking.No new page should open.I heard ki Tooltip can be used... by placing the mouse on that flight number.Can you pliz give me the code and how
Advertisements
Tooltip Alignment
Tooltip Alignment  Dear Sir, I have a code given below,which gived tooltip design.But,in one table i am getting three students' information.On... near the student's roll number.My code to show the tooltip is given below
Tooltip alignment
Tooltip alignment  Dear Sir, I have a code given below,which gived tooltip design.But,in one table i am getting three students' information.On... near the student's roll number.My code to show the tooltip is given below
ToolTip in Flex4
ToolTip in Flex4: ToolTip is used for display the message. When user moves a mouse towards a component a message will appear it is a ToolTip and user clicks the mouse button the message disappears. You can set the one ToolTip
tooltip problem - Swing AWT
tooltip problem  Hi All, I am using SWT_AWT bridge in my code... Composite. My problem is that I am unable to see the tooltip for this button even... in advance.   Hi friend, Code to help in solving the program
Tooltip problem - JSP-Servlet
Tooltip problem  In my project i used google map...I want show tooltip on marker when marker created not on marker event like mouseover,click
jsf custom tooltip
jsf custom tooltip  I wants to know that is it possible to add a tooltip to the Custom JSF
ToolTip in IE6 for dropdown
ToolTip in IE6 for dropdown  Hi Can any one tell me how to apply Tool tip in drop down tag in IE6 ?? Thanks
Flex Simple ToolTip
Flex ToolTip:- The Flex ToolTip are a mechanism (method) to give the useful information to the user. Flex ToolTip are display information when a user moves... , ToolTip are appear and after click that particular component, ToolTip
Flex ToolTip Style and StyleManager
set width for ToolTip that's init() method. Running this code after that you...Set ToolTip Style In Flex:- We discuss about how to set 'Style' for the tooltip in Flex with the help of <mx:Style> Tag. In this tutorial you
ToolTip style in Flex4
ToolTip style in Flex4: In this example you can see how we can change the style of ToolTip. In this example we use a internal style sheet for change the style of ToolTip. Example: <?xml version="1.0" encoding
Flex ToolTip with TabBar and ToolTipManager
about ToolTip with TabBar controls. You can see how to use tooltip in TabBar controls. TabBar class support ToolTip their data providers. In the following example...(source='assets/flower.jpeg')" toolTip="It is a beautiful
Bar Chart using JSP and tooltip to be implemented
Bar Chart using JSP and tooltip to be implemented  Hi Deepak, I have generated a bar chart in JSP using JFreeCharts but I could not get the tool tip for that. Please any one suggest me how to do that or provide some code. Help
ToolTip Effect in Flex4
ToolTip Effect in Flex4: In this example you can see how we can use the effect with tooltip. You can provide the effect to the tooltip by using...;; @namespace mx "library://ns.adobe.com/flex/mx"; mx|ToolTip{ font
jQuery tooltip
What is tooltip ? A tooltip is help box or text that appears when you rollover... attribute of an image tag will be displayed as a tooltip by a browser when you rollover... to every image and hyperlink. Getting Started with jquery tooltip: In this example
Create ToolTip Text in SWT
Create ToolTip Text in SWT       In this section, you will learn how to create ToolTip. The ToolTip is the element of graphical user interface used in the conjunction
ToolTip style using styleManager in Flex4
ToolTip style using styleManager in Flex4: In this example you can see how we can change the style of ToolTip. In this example we use a styleManager for change the style of ToolTip. Example: <?xml version="1.0
ToolTip with ViewStack in Flex4
ToolTip with ViewStack in Flex4: In this example you can see how we can use the tooltip with ViewStack container. You will use ToolTips on child elements...;; mx|ToolTip{ font-family:Verdana; font-weight:bold; color:#FFFFFF
code
code  code for android sample program
code
code    how to write this in java
Code
Code  code for connecting c lang to database
code for this is
code for this is  a b c d c b a a b c c b a a b b a a a code
code
code  please provide code for custom tags.by using currdate tag we need to get current date?please give me code
code
code   hi I need help in creating a java code that reminds user on a particular date about their festival. i have no clue of how to do it.. am looking forward to seek help from you
code
the correct code for a program.The output of the program is listed below...: {Block 5} ADDRESS-3: {San Juan} POST CODE:{6745} ENTER CODE (XX TO stop) CODE:{FF1} QUANTITY:{2} CODE:{TR4} QUANTITY:{1} CODE:XX INVOICE FOR YOUR ORDER Harry
code
code to create the RMI client on the local machine: import java.rmi.*; public... : "+e); } } } However, when the preceding code is executed it results... the correct code
code
code  i have four textboxes.whenever i click on up,down,left or down arrows then the cursor move to another textbox based on the key pressed.i want code for this in javascript
code
line of code to print the amount he should be paid as allowance
code
code  write a program to encrypt and decrypt the cipher text "adfgvx"   Hi Friend, Try the following code: import java.security.*; import javax.crypto.*; import javax.crypto.spec.*; import java.io.
JAVA code For
JAVA code For   JAVA code For "Traffic signals Identification for vehicles
 

 

 

DMCA.com