mariocesar Posted December 20, 2007 Share Posted December 20, 2007 Hello, I have this script that pull info from a table pluss a link to an image allready in a folder, when you go over the image. it display the original image size, works fine the problem is that now I have more than 35 products and when the user roolls over the image the image displays ok but all the way to the top, so the user can not see the image, here is the script: <div align="center"><img src="<?php echo $row['productimage']; ?>" width="60" height="60" border="0" onMouseOver="javascript: showDetails('<?php echo $row['productimage']; ?>');" onMouseOut="javascript: offDetails();"> </div> <div align="left" style=" float:left; position:absolute; display:none; z-index:10; padding-left:11px; padding-top:10px; padding-right:11px; background-color:#DFE6E3;" id="det"> <img src="" id="img5" name="ing5" style="border:0px solid #666666; z-index:10;"></div> here is the js: <script language="javascript" type="text/javascript"> function showDetails(x) { document.getElementById('det').style.display=''; document.getElementById('img5').src=x; } function offDetails() { document.getElementById('det').style.display='none'; } </script> How can I see the image rigth on the screen, thanks Quote Link to comment https://forums.phpfreaks.com/topic/82561-image-shows-all-the-way-on-the-top/ Share on other sites More sharing options...
phpQuestioner Posted December 20, 2007 Share Posted December 20, 2007 don't align div to center - set the div style to: text-align:right do something like this: <script language="javascript" type="text/javascript"> function showDetails(x) { document.getElementById('det').style.display=''; document.getElementById('img5').src=x; } function offDetails() { document.getElementById('det').style.display='none'; } </script> <div style="text-align:right"><img src="<?php echo $row['productimage']; ?>" width="60" height="60" border="0" onMouseOver="javascript: showDetails('<?php echo $row['productimage']; ?>');" onMouseOut="javascript: offDetails();"> </div> <div align="left" style=" float:left; position:absolute; display:none; z-index:10; padding-left:11px; padding-top:10px; padding-right:11px; background-color:#DFE6E3;" id="det"> <img src="" id="img5" name="ing5" style="border:0px solid #666666; z-index:10;"></div> Quote Link to comment https://forums.phpfreaks.com/topic/82561-image-shows-all-the-way-on-the-top/#findComment-419764 Share on other sites More sharing options...
mariocesar Posted December 20, 2007 Author Share Posted December 20, 2007 thanks phpQuestioner, but don't work here is the link http://www.flexoplateonline.com/product/salesshetehtm2.php as you can see when you go to the product on the boton you can not see the image because displays all the way to the top. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/82561-image-shows-all-the-way-on-the-top/#findComment-419787 Share on other sites More sharing options...
phpQuestioner Posted December 20, 2007 Share Posted December 20, 2007 you need to either set your image div style "top" properties to increase based on your thumbnail image location or you need to create separate divs for each of your enlarged images and place them below/beside each of your thumbnail images (you can do this dynamically server side - so its not a lot of hard coding). Quote Link to comment https://forums.phpfreaks.com/topic/82561-image-shows-all-the-way-on-the-top/#findComment-419858 Share on other sites More sharing options...
mariocesar Posted December 21, 2007 Author Share Posted December 21, 2007 thanks but I can not add the separate div for each thumbnail, because everything is dynamic here is the link one more time http://www.flexoplateonline.com/product/salesshetehtm2.php a php script populates the image and the rest of the description, quantities and prices if you go over the image, shows you a biger image that is fine, but when you go to a product in the midle of the page you can not see the image because it shows all the way on the top, please help. how can I see the image rgth on the screen even if I go to product #20. thanks Quote Link to comment https://forums.phpfreaks.com/topic/82561-image-shows-all-the-way-on-the-top/#findComment-420143 Share on other sites More sharing options...
phpQuestioner Posted December 21, 2007 Share Posted December 21, 2007 you do as I said and use javascript to change the div's "top" property on thumbnail mouseover or you can add the extra div's dynamically. you also could create a floating div (google "dhtml floating div" for more details). these are about your only choices. Quote Link to comment https://forums.phpfreaks.com/topic/82561-image-shows-all-the-way-on-the-top/#findComment-420171 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.