php_begins Posted December 5, 2011 Share Posted December 5, 2011 i need to be able to expand and hide images too when i click on a button.. <script type="text/javascript"> function toggleMe(a){ var e=document.getElementById(a); if(!e)return true; if(e.style.display=="none"){ e.style.display="block" } else { e.style.display="none" } return true; } </script> <input type="button" class="button" onclick="return toggleMe('para1')" value="Show all Banners"> <div id="para1" style="display:none"> <? $allbanners=mysql_query("SELECT * from ads where active='Y' ) or die(mysql_error()); while($allbanners_results = mysql_fetch_assoc($allbanners)) { $banner_image_path = $allbanners_results['image_path']; $banner_url = $allbanners_results['URL']; $banner_title = $allbanners_results['title']; echo "<tr><td width='468' align='left'><a href='".$banner_url."'><B><font size='3' face='arial'>".$banner_title."</font></B><img border=0 src='./images/" . $banner_image_path . "'></a></td></tr>"; echo "testing" } ?> </div> The above code works only for text expansion. i want to expand and hide images upon click 'Show All Banners' Link to comment https://forums.phpfreaks.com/topic/252519-expand-and-hide-images/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.