February 15, 201214 yr Can anybody help me with this little problem i've got. I have a product catalogue in a mysql database which can be queried and return the products a customer is looking for. I want to have a hidden layer which appears when the user hovers over the product description which brings up the price, stock and order button. I have no problem getting the hidden layer to pop up, but i can't seem to get the product information to appear in the box. I am using PHP/MySql to query the database, and obviously the layer is a javascript (onMouseOver) function. Any help / advice would be greatly appreciated
February 15, 201214 yr Author Ok.....very basic Javascript for the hidden layer <script language ="JavaScript" type="text/javascript"> <!-- function showLayer() { document.getElementById("info").style.visibility="visible"; } function hideLayer() { document.getElementById("info").style.visibility="hidden"; } //--> Basic PHP to select the products from the database (excuse my basic PHP).... $q3 = "select * from products where pcode = '$row2[pcode]'"; $r3 = mysqli_query($cxn,$q3) or die ('Error Q3 customer log'); while($row3 = mysqli_fetch_assoc($r3)) { include("gp.inc"); echo "<table width='70%' style='float: left;'> <tr> <td width='40%' onMouseOver='showLayer('info');">$row3[description]</td> The <td> with the description listed is where i want the layer to appear above with product info.......
Create an account or sign in to comment