Calling Multiple functions simultaneously
        Posted  
        
            by Noob
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Noob
        
        
        
        Published on 2010-05-07T16:01:06Z
        Indexed on 
            2010/05/07
            16:08 UTC
        
        
        Read the original article
        Hit count: 227
        
JavaScript
|jQuery
I'm trying to call two different functions for two different HTML elements at the same time, but the second function isn't being read at all. I'm also trying to use the id to specify which corresponding elements to grab data from. Here's what I have:
function changeImage(id)
 {
  var s = document.getElementById('showcase');
  var simg = s.getElementsByTagName('img');
  var slen = simg.length;
  for(i=0; i < slen; i++)
  {
   simg[i].style.display = 'none';
  }
  $('#' + id).fadeIn('slow', 0);
  function createComment(jim)
 {
  //alert('hello?');
  var d = document.getElementById('description');
  var dh = document.getElementsByTagName('p');
  var dlen = dh.length;
  //alert(dh);
  for(i=0; i < dlen; i++)
  {
   alert(dh);
   dh[i].style.display = 'none';
  }
  $('#' + jim).fadeIn('slow', 0);
 }
© Stack Overflow or respective owner