Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.